Code example for SessionFactory

Methods: openSession

0
        return factory.getCurrentSession();
    } 
 
    private Session listSession() {
        if (listSession == null) {
            listSession = factory.openSession();
        } 
 
        return listSession;
    } 
 
    private void begin() { 
        begin(session()); 
    } 
 
    private void begin(Session session) {
        Transaction transaction = session.beginTransaction();
        transaction.begin();
        transactions.push(transaction);
    } 
Connect your IDE to all the code out there  Get Codota for Java