Code example for SessionFactory

Methods: getCurrentSession

0
public class HibernatePersistenceAdapter implements TidePersistenceAdapter { 
	 
	private Session session;
		 
	public HibernatePersistenceAdapter(SessionFactory sessionFactory) {
		this.session = sessionFactory.getCurrentSession();
	} 
	 
	public HibernatePersistenceAdapter(Session session) {
		this.session = session;
	} 
 
    /** 
     * Find an entity in the persistence context 
     * @param entityClass class of the looked up entity 
     * @param id entity identifier 
     * @return the entity with the persistence context. 
     */ 
    public Object find(Class<?> entityClass, Serializable id) {
    	// Use Criteria instead of Session.load() to avoid getting proxies 
Contextual code suggestions in your IDE  Get Codota for Java