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

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

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