Search in sources :

Example 21 with HibernatePessoaDAO

use of com.tomasio.projects.trainning.dao.HibernatePessoaDAO in project trainning by fernandotomasio.

the class TestCursos method main.

public static void main(String[] args) throws DAOException {
    HibernatePessoaDAO dao = new HibernatePessoaDAO();
    SessionFactory factory = HibernateUtil.getSessionFactory();
    dao.setSessionFactory(factory);
    Session session = factory.openSession();
    Transaction tx = session.beginTransaction();
    List<Pessoa> pessoas = dao.search("042.745.547-24", null);
    for (Pessoa pessoa : pessoas) {
        System.out.println(pessoa.getNome());
    }
    tx.commit();
    session.close();
}
Also used : SessionFactory(org.hibernate.SessionFactory) Transaction(org.hibernate.Transaction) HibernatePessoaDAO(com.tomasio.projects.trainning.dao.HibernatePessoaDAO) Session(org.hibernate.Session) Pessoa(com.tomasio.projects.trainning.model.Pessoa)

Aggregations

HibernatePessoaDAO (com.tomasio.projects.trainning.dao.HibernatePessoaDAO)21 PessoaDAO (com.tomasio.projects.trainning.dao.PessoaDAO)20 DAOException (com.tomasio.projects.trainning.exception.DAOException)19 Pessoa (com.tomasio.projects.trainning.model.Pessoa)18 Organizacao (com.tomasio.projects.trainning.model.Organizacao)14 ImportTurmasImplEfetivasFromTabelao (com.tomasio.projects.trainning.migration.ImportTurmasImplEfetivasFromTabelao)10 ResultSet (java.sql.ResultSet)10 SQLException (java.sql.SQLException)10 Statement (java.sql.Statement)10 HibernateOrganizacaoDAO (com.tomasio.projects.trainning.dao.HibernateOrganizacaoDAO)8 OrganizacaoDAO (com.tomasio.projects.trainning.dao.OrganizacaoDAO)8 Date (java.sql.Date)8 HibernateIndicacaoDAO (com.tomasio.projects.trainning.dao.HibernateIndicacaoDAO)6 IndicacaoDAO (com.tomasio.projects.trainning.dao.IndicacaoDAO)6 Date (java.util.Date)5 HibernateMatriculaDAO (com.tomasio.projects.trainning.dao.HibernateMatriculaDAO)4 MatriculaDAO (com.tomasio.projects.trainning.dao.MatriculaDAO)4 Periodo (com.tomasio.projects.trainning.model.Periodo)3 AnotacaoDAO (com.tomasio.projects.trainning.dao.AnotacaoDAO)2 HibernateAnotacaoDAO (com.tomasio.projects.trainning.dao.HibernateAnotacaoDAO)2