Code example for SessionFactory

Methods: getCurrentSession

0
	public void setHql(String hql) {
		this.hql = hql;
	} 
 
	protected Object[] getArgs(ScreenContext context) {	
		Object result = sessionFactory.getCurrentSession()
				.createQuery(hql)
				.uniqueResult();
		 
		if (result == null) { 
			return null; 
		} 
		else if (result instanceof Object[]) { 
			return (Object[]) result;			 
		} 
		else { 
			return new Object[] { result }; 
		} 
	} 
 
Contextual code suggestions in your IDE  Get Codota for Java