Code example for Session

Methods: delete

0
		return entity;
	} 
	 
	public void delete(T entity) {
		Session session = PersistContext.getSession(isCloudStackSession);
		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);