Example usage for org.hibernate Query list

List of usage examples for org.hibernate Query list

Introduction

In this page you can find the example usage for org.hibernate Query list.

Prototype

List<R> list();

Source Link

Document

Return the query results as a List.

Usage

From source file:bbdd.Gestor_de_Juegos__DAO.java

public static List queryGestor_de_Juegos__(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From bbdd.Gestor_de_Juegos__ as Gestor_de_Juegos__");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*  ww  w . j av a  2s .  c o m*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("this", lockMode);
        return query.list();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:bbdd.Gestor_de_Usuarios__DAO.java

public static List queryGestor_de_Usuarios__(PersistentSession session, String condition, String orderBy)
        throws PersistentException {
    StringBuffer sb = new StringBuffer("From bbdd.Gestor_de_Usuarios__ as Gestor_de_Usuarios__");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/*ww  w. jav a 2  s  .co m*/
        Query query = session.createQuery(sb.toString());
        return query.list();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:bbdd.Gestor_de_Usuarios__DAO.java

public static List queryGestor_de_Usuarios__(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From bbdd.Gestor_de_Usuarios__ as Gestor_de_Usuarios__");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//w  w w  .  j av  a2  s  .  c o  m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("this", lockMode);
        return query.list();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:bbdd.JuegoDAO.java

public static List queryJuego(PersistentSession session, String condition, String orderBy)
        throws PersistentException {
    StringBuffer sb = new StringBuffer("From bbdd.Juego as Juego");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from ww  w.java  2 s . com
        Query query = session.createQuery(sb.toString());
        return query.list();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:bbdd.JuegoDAO.java

public static List queryJuego(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From bbdd.Juego as Juego");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {// w ww .  j  a v a2  s.  co m
        Query query = session.createQuery(sb.toString());
        query.setLockMode("this", lockMode);
        return query.list();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:bbdd.Juego_PublicoDAO.java

public static List queryJuego_Publico(PersistentSession session, String condition, String orderBy)
        throws PersistentException {
    StringBuffer sb = new StringBuffer("From bbdd.Juego_Publico as Juego_Publico");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {// w w  w. j a v  a 2  s .  c  o  m
        Query query = session.createQuery(sb.toString());
        return query.list();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:bbdd.Juego_PublicoDAO.java

public static List queryJuego_Publico(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From bbdd.Juego_Publico as Juego_Publico");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {/* w  w  w.jav a 2 s.  c  o m*/
        Query query = session.createQuery(sb.toString());
        query.setLockMode("this", lockMode);
        return query.list();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:bbdd.MovimientoDAO.java

public static List queryMovimiento(PersistentSession session, String condition, String orderBy)
        throws PersistentException {
    StringBuffer sb = new StringBuffer("From bbdd.Movimiento as Movimiento");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from   w w w  .  j  a  v  a 2  s.c om
        Query query = session.createQuery(sb.toString());
        return query.list();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:bbdd.MovimientoDAO.java

public static List queryMovimiento(PersistentSession session, String condition, String orderBy,
        org.hibernate.LockMode lockMode) throws PersistentException {
    StringBuffer sb = new StringBuffer("From bbdd.Movimiento as Movimiento");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//www .  j av a  2 s .c  om
        Query query = session.createQuery(sb.toString());
        query.setLockMode("this", lockMode);
        return query.list();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}

From source file:bbdd.Partida_PublicaDAO.java

public static List queryPartida_Publica(PersistentSession session, String condition, String orderBy)
        throws PersistentException {
    StringBuffer sb = new StringBuffer("From bbdd.Partida_Publica as Partida_Publica");
    if (condition != null)
        sb.append(" Where ").append(condition);
    if (orderBy != null)
        sb.append(" Order By ").append(orderBy);
    try {//from   w w  w.  ja v  a  2s .  co m
        Query query = session.createQuery(sb.toString());
        return query.list();
    } catch (Exception e) {
        e.printStackTrace();
        throw new PersistentException(e);
    }
}