Beispiel #1
0
  @Override
  public List<Endereco> findAll() {
    sessionFactoryCreator.create();
    session = sessionFactoryCreator.getInstance();

    return session.createCriteria(Assunto.class).list();
  }
Beispiel #2
0
 @Override
 public void update(Endereco object) {
   sessionFactoryCreator.create();
   session = sessionFactoryCreator.getInstance();
   Transaction transaction = session.beginTransaction();
   session.update(object);
   transaction.commit();
   sessionFactoryCreator.destroy();
 }
Beispiel #3
0
  @Override
  public void save(Endereco endereco) {

    sessionFactoryCreator.create();
    session = sessionFactoryCreator.getInstance();
    Transaction transaction = session.beginTransaction();
    session.save(endereco);
    transaction.commit();
    sessionFactoryCreator.destroy();
  }