List of usage examples for org.hibernate Query list
List<R> list();
From source file:bo.com.offercruz.dal.impl.PermisoHibernateDAO.java
@Override public List<Permiso> obtenerPermisosHijos(Integer idPermisoPadre) { Query query = getSession().createQuery("select p from Permiso p WHERE p.permisoPadreId = :idPermisoPadre "); query.setParameter("idPermisoPadre", idPermisoPadre); return query.list(); }
From source file:bo.com.offercruz.dal.impl.PermisoHibernateDAO.java
@Override public List<Permiso> obtenerPermisosHijos(Integer idPermisoPadre, int idPerfil) { Query query = getSession().createQuery( "select p from Permiso p join p.perfils t WHERE p.permisoPadreId = :idPermisoPadre AND t.id = :idPerfil "); query.setParameter("idPerfil", idPerfil); query.setParameter("idPermisoPadre", idPermisoPadre); return query.list(); }
From source file:bo.com.offercruz.dal.impl.PermisoHibernateDAO.java
@Override public List<Permiso> obtenerPermisosPadres(int tipo) { Query query = getSession() .createQuery("select p from Permiso p WHERE p.permisoPadreId = null AND p.tipo = :tipo "); query.setParameter("tipo", tipo); return query.list(); }
From source file:bo.gaceta.rcb.dao.impl.TbInCiiuImpl.java
public List<TbInCiiu> list() throws Exception { Session session = HibernateUtil.getSessionFactory().openSession(); session.beginTransaction();/*from w w w.j a v a2 s . co m*/ session.flush(); Query query = session.createQuery("SELECT e FROM TbInCiiu e"); List<TbInCiiu> entities = query.list(); session.getTransaction().commit(); session.close(); return entities; }
From source file:bo.gaceta.rcb.dao.impl.TbInCiiuImpl.java
public List<TbInCiiu> listFiltroClase(String txtClase) throws Exception { Session session = HibernateUtil.getSessionFactory().openSession(); session.beginTransaction();//from www. j a v a 2 s.c o m session.flush(); Query query = session.createQuery("SELECT e FROM TbInCiiu e WHERE e.clase LIKE :_txtBusca") .setParameter("_txtBusca", "%" + txtClase + "%"); List<TbInCiiu> entities = query.list(); session.getTransaction().commit(); session.close(); return entities; }
From source file:bo.gaceta.rcb.dao.impl.TbInCiiuImpl.java
public List<TbInCiiu> listSeccion() throws Exception { Session session = HibernateUtil.getSessionFactory().openSession(); session.beginTransaction();//from w w w. j a v a2s. c o m session.flush(); Query query = session.createQuery("SELECT e FROM TbInCiiu e GROUP BY e.idSeccion"); List<TbInCiiu> entities = query.list(); session.getTransaction().commit(); session.close(); return entities; }
From source file:bo.gaceta.rcb.dao.impl.TbInCiiuImpl.java
public List<TbInCiiu> listDivision(String idSeccion) throws Exception { Session session = HibernateUtil.getSessionFactory().openSession(); session.beginTransaction();/*from w w w . ja v a 2s . c om*/ session.flush(); Query query = session .createQuery("SELECT e FROM TbInCiiu e WHERE e.idSeccion=:_txtBusca GROUP BY e.idDivision") .setParameter("_txtBusca", idSeccion); List<TbInCiiu> entities = query.list(); session.getTransaction().commit(); session.close(); return entities; }
From source file:bo.gaceta.rcb.dao.impl.TbInCiiuImpl.java
public List<TbInCiiu> listGrupo(String idDivision) throws Exception { Session session = HibernateUtil.getSessionFactory().openSession(); session.beginTransaction();//from w w w. j av a 2 s . c om session.flush(); Query query = session .createQuery("SELECT e FROM TbInCiiu e WHERE e.idDivision=:_txtBusca GROUP BY e.idGrupo") .setParameter("_txtBusca", idDivision); List<TbInCiiu> entities = query.list(); session.getTransaction().commit(); session.close(); return entities; }
From source file:bo.gaceta.rcb.dao.impl.TbInCiiuImpl.java
public List<TbInCiiu> listClasebySeccion(String idSeccion) throws Exception { Session session = HibernateUtil.getSessionFactory().openSession(); session.beginTransaction();/*from w w w . j a va2 s. c o m*/ session.flush(); Query query = session.createQuery("SELECT e FROM TbInCiiu e WHERE e.idSeccion=:_txtBusca") .setParameter("_txtBusca", idSeccion); List<TbInCiiu> entities = query.list(); session.getTransaction().commit(); session.close(); return entities; }