Code example for Session

Methods: flush

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();
    } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE