Code example for Session

Methods: createQuery

			List<PageEditareaT> list = this.getHibernateTemplate().executeFind(new HibernateCallback() {
				String queryString = "from PageEditareaT  as pea where pea.pageid=:pageid and pea.typeid=:typeid and pea.state=:state";
				public Object doInHibernate(Session session) throws HibernateException, SQLException {
					Query query = session.createQuery(queryString);
					query.setParameter("pageid", pageid);
					query.setParameter("typeid", typeid);
					query.setParameter("state", state);
					List list = query.list();
					return list;
			if (list.size() > 0) {
				return list;
			return null; 
		} catch (RuntimeException re) {
			log.error("find all PageEditareaT error state", re);
			throw re;
Experience pair programming with AI  Get Codota for Java