Code example for SessionFactory

Methods: getCurrentSession

0
	/* (non-Javadoc) 
	 * @see org.openiam.idm.srvc.orgpolicy.service.OrgPolicyUserLogDAO#findLogForUser(java.lang.String) 
	 */ 
	public List<OrgPolicyUserLog> findLogForUser(String userId) {
		try { 
			Session session = sessionFactory.getCurrentSession();
			Query qry = session.createQuery("from org.openiam.idm.srvc.orgpolicy.dto.OrgPolicyUserLog o " +
				" where o.userId = :userId " +	 
				" order by o.timeStamp asc"); 
			qry.setString("userId", userId);
			List<OrgPolicyUserLog> results = (List<OrgPolicyUserLog>)qry.list();
			return results;
		} catch (HibernateException re) {
			log.error("get failed", re);
			throw re;
		} 
	} 
 
 
} 
Experience pair programming with AI  Get Codota for Java