Code example for SessionFactory

Methods: getCurrentSession

0
 
    /** 
     * Get the current Hibernate Session. 
     */ 
    public Session getSession() {
        return _sessionFactory.getCurrentSession();
    } 
 
    /** 
     * Returns flag which shows whether " where .. join ... for update" kind of queries can be used (supported 
     * by currently effective {@link org.hibernate.dialect.Dialect}. If it's {@code false} than sub-query fallback 
     * should be invoked instead. 
     * 
     * @return currently returns false only for {@link org.hibernate.dialect.IngresDialect} 
     */ 
    public boolean canJoinForUpdate() { 
        return _canJoinForUpdate;
    }