Code example for SessionFactory

Methods: getCurrentSession

0
	 *  
	 * @return hibernate session 
	 */ 
	protected Session getSession()
	{ 
		return factory.getCurrentSession();
	} 
 
	/** 
	 * Load a {@link Contact} from the DB, given it's <tt>id</tt> . 
	 *  
	 * @param id 
	 *            The id of the Contact to load. 
	 * @return Contact 
	 */ 
	public Contact load(long id)
	{ 
		return (Contact)getSession().get(Contact.class, Long.valueOf(id));
	} 
 
Contextual code suggestions in your IDE  Get Codota for Java