List of usage examples for org.hibernate Query list
List<R> list();
From source file:PeriodoEmpleadoEnObra.java
public static List queryPeriodoEmpleadoEnObra(PersistentSession session, String condition, String orderBy) throws PersistentException { StringBuffer sb = new StringBuffer("From PeriodoEmpleadoEnObra as PeriodoEmpleadoEnObra"); 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.co m*/ Query query = session.createQuery(sb.toString()); return query.list(); } catch (Exception e) { e.printStackTrace(); throw new PersistentException(e); } }
From source file:PeriodoEmpleadoEnObra.java
public static List queryPeriodoEmpleadoEnObra(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException { StringBuffer sb = new StringBuffer("From PeriodoEmpleadoEnObra as PeriodoEmpleadoEnObra"); 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 a2s. co m*/ Query query = session.createQuery(sb.toString()); query.setLockMode("PeriodoEmpleadoEnObra", lockMode); return query.list(); } catch (Exception e) { e.printStackTrace(); throw new PersistentException(e); } }
From source file:Proveedor.java
public static List queryProveedor(PersistentSession session, String condition, String orderBy) throws PersistentException { StringBuffer sb = new StringBuffer("From Proveedor as Proveedor"); if (condition != null) sb.append(" Where ").append(condition); if (orderBy != null) sb.append(" Order By ").append(orderBy); try {/* ww w .j av a2 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:Proveedor.java
public static List queryProveedor(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException { StringBuffer sb = new StringBuffer("From Proveedor as Proveedor"); 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 om Query query = session.createQuery(sb.toString()); query.setLockMode("Proveedor", lockMode); return query.list(); } catch (Exception e) { e.printStackTrace(); throw new PersistentException(e); } }
From source file:EmpleadoAlmacen.java
public static List queryEmpleadoAlmacen(PersistentSession session, String condition, String orderBy) throws PersistentException { StringBuffer sb = new StringBuffer("From EmpleadoAlmacen as EmpleadoAlmacen"); if (condition != null) sb.append(" Where ").append(condition); if (orderBy != null) sb.append(" Order By ").append(orderBy); try {//ww w .ja v 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:EmpleadoAlmacen.java
public static List queryEmpleadoAlmacen(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException { StringBuffer sb = new StringBuffer("From EmpleadoAlmacen as EmpleadoAlmacen"); 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 a2 s . c om Query query = session.createQuery(sb.toString()); query.setLockMode("EmpleadoAlmacen", lockMode); return query.list(); } catch (Exception e) { e.printStackTrace(); throw new PersistentException(e); } }
From source file:Material.java
public static List queryMaterial(PersistentSession session, String condition, String orderBy) throws PersistentException { StringBuffer sb = new StringBuffer("From Material as Material"); if (condition != null) sb.append(" Where ").append(condition); if (orderBy != null) sb.append(" Order By ").append(orderBy); try {//from w ww .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:Material.java
public static List queryMaterial(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException { StringBuffer sb = new StringBuffer("From Material as Material"); if (condition != null) sb.append(" Where ").append(condition); if (orderBy != null) sb.append(" Order By ").append(orderBy); try {/*from w ww .j a v a 2 s .c om*/ Query query = session.createQuery(sb.toString()); query.setLockMode("Material", lockMode); return query.list(); } catch (Exception e) { e.printStackTrace(); throw new PersistentException(e); } }
From source file:Obra.java
public static List queryObra(PersistentSession session, String condition, String orderBy) throws PersistentException { StringBuffer sb = new StringBuffer("From Obra as Obra"); if (condition != null) sb.append(" Where ").append(condition); if (orderBy != null) sb.append(" Order By ").append(orderBy); try {/* w w w . ja va 2s . c o m*/ Query query = session.createQuery(sb.toString()); return query.list(); } catch (Exception e) { e.printStackTrace(); throw new PersistentException(e); } }
From source file:Obra.java
public static List queryObra(PersistentSession session, String condition, String orderBy, org.hibernate.LockMode lockMode) throws PersistentException { StringBuffer sb = new StringBuffer("From Obra as Obra"); if (condition != null) sb.append(" Where ").append(condition); if (orderBy != null) sb.append(" Order By ").append(orderBy); try {//www. ja v a 2 s. co m Query query = session.createQuery(sb.toString()); query.setLockMode("Obra", lockMode); return query.list(); } catch (Exception e) { e.printStackTrace(); throw new PersistentException(e); } }