Code example for Session

Methods: createQuery

0
		session.delete(entity);
	} 
	 
	public T queryEntity(String hql, Object[] params) {
		Session session = PersistContext.getSession(isCloudStackSession);
		Query query = session.createQuery(hql);
		query.setMaxResults(1);
		QueryHelper.bindParameters(query, params);
		return (T)query.uniqueResult();
	} 
	 
	public List<T> queryEntities(String hql, Object[] params) {
		Session session = PersistContext.getSession(isCloudStackSession);
		Query query = session.createQuery(hql);
		QueryHelper.bindParameters(query, params);
		 
		return (List<T>)query.list();
	} 
	 
	public List<T> queryEntities(String hql, int offset, int limit, Object[] params) {