@Override public List<Endereco> findAll() { sessionFactoryCreator.create(); session = sessionFactoryCreator.getInstance(); return session.createCriteria(Assunto.class).list(); }
@Override public void update(Endereco object) { sessionFactoryCreator.create(); session = sessionFactoryCreator.getInstance(); Transaction transaction = session.beginTransaction(); session.update(object); transaction.commit(); sessionFactoryCreator.destroy(); }
@Override public void save(Endereco endereco) { sessionFactoryCreator.create(); session = sessionFactoryCreator.getInstance(); Transaction transaction = session.beginTransaction(); session.save(endereco); transaction.commit(); sessionFactoryCreator.destroy(); }