Code example for SessionFactory

Methods: getCurrentSession

0
     * 
     * @throws org.springframework.beans.BeansException 
     *          when can't find 'sessionFactory' bean 
     */ 
    protected void flush() throws BeansException {
        Session currentSession = sessionFactory.getCurrentSession();
        currentSession.flush();
    } 
 
    /** 
     * Flush search indexes, to be done after a reindex() or reindexAll() operation 
     */ 
    public void flushSearchIndexes() { 
        Session currentSession = sessionFactory.getCurrentSession();
        final FullTextSession fullTextSession = Search.getFullTextSession(currentSession);
        fullTextSession.flushToIndexes();
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java