Code example for SessionFactory

Methods: getCurrentSession

0
		} 
	} 
	 
	public List<PolicyDefParam> findPolicyDefParamByGroup(String defId, String group) {
		try { 
			Session session = sessionFactory.getCurrentSession();
			Query qry = session.createQuery("from PolicyDefParam as p "
					+ " where p.policyDefId = :defId and  p.paramGroup = :group" ); 
			qry.setString("group", group);
			qry.setString("defId", defId);
			List<PolicyDefParam> result = (List<PolicyDefParam>) qry.list();
			if (result == null || result.size() == 0)
				return null; 
			 
			return result;			
		} catch (HibernateException re) {
			log.error("findPolicyDefParamByGroup failed", re);
			throw re;
		}		 
	}