Пример #1
0
 public void saveOrUpdate(PontoDeInteresse poi) throws HibernateException {
   Session session = HibernateConnector.getInstance().getSession();
   Transaction t = session.beginTransaction();
   session.saveOrUpdate(poi);
   t.commit();
   session.close();
 }
Пример #2
0
 public Long save(PontoDeInteresse poi) throws HibernateException {
   Session session = HibernateConnector.getInstance().getSession();
   Transaction t = session.beginTransaction();
   Long id = (Long) session.save(poi);
   t.commit();
   session.close();
   return id;
 }
Пример #3
0
  public List<PontoDeInteresse> listaPontosDeInteresse() {
    Session session = HibernateConnector.getInstance().getSession();
    Criteria cri = session.createCriteria(PontoDeInteresse.class);

    List<PontoDeInteresse> lista = (List<PontoDeInteresse>) cri.list();
    session.close();

    return lista;
  }