Search in sources :

Example 81 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class TrainningServiceSimpleImpl method updatePlano.

@Override
@Transactional
public void updatePlano(PlanoDTO planoDTO) {
    PlanoDAO dao = factory.getPlanoDAO();
    Plano model = new Plano();
    assemblyEntity(planoDTO, model);
    try {
        dao.update(model);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) PlanoDAO(com.tomasio.projects.trainning.dao.PlanoDAO) Plano(com.tomasio.projects.trainning.model.Plano) Transactional(org.springframework.transaction.annotation.Transactional)

Example 82 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class TrainningServiceSimpleImpl method findArea.

@Override
@Transactional(readOnly = true)
public AreaDTO findArea(Long id) {
    AreaDAO dao = factory.getAreaDAO();
    Area area = null;
    try {
        area = dao.find(id);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    if (!(area == null)) {
        return area.createDTO();
    } else {
        return null;
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) Area(com.tomasio.projects.trainning.model.Area) CoreException(com.tomasio.projects.trainning.exeption.CoreException) AreaDAO(com.tomasio.projects.trainning.dao.AreaDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 83 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class TrainningServiceSimpleImpl method findCursoByCodigo.

@Override
@Transactional(readOnly = true)
public CursoDTO findCursoByCodigo(String codigo) {
    CursoDAO dao = factory.getCursoDAO();
    Curso curso = null;
    try {
        curso = dao.findByCodigo(codigo);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    if (curso != null) {
        return curso.createDTO();
    } else {
        return null;
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Curso(com.tomasio.projects.trainning.model.Curso) CursoDAO(com.tomasio.projects.trainning.dao.CursoDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 84 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class TrainningServiceSimpleImpl method findCurso.

@Override
@Transactional(readOnly = true)
public CursoDTO findCurso(Long id) {
    CursoDAO dao = factory.getCursoDAO();
    Curso curso = null;
    try {
        curso = dao.find(id);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    if (curso != null) {
        return curso.createDTO();
    } else {
        return null;
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Curso(com.tomasio.projects.trainning.model.Curso) CursoDAO(com.tomasio.projects.trainning.dao.CursoDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 85 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class TrainningServiceSimpleImpl method updateArea.

@Override
@Transactional
public void updateArea(AreaDTO area) {
    AreaDAO dao = factory.getAreaDAO();
    Area _area = new Area(area);
    try {
        dao.update(_area);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) Area(com.tomasio.projects.trainning.model.Area) CoreException(com.tomasio.projects.trainning.exeption.CoreException) AreaDAO(com.tomasio.projects.trainning.dao.AreaDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

DAOException (com.tomasio.projects.trainning.exception.DAOException)643 CoreException (com.tomasio.projects.trainning.exeption.CoreException)388 Transactional (org.springframework.transaction.annotation.Transactional)385 HibernateException (org.hibernate.HibernateException)186 Session (org.hibernate.Session)186 ParseException (java.text.ParseException)112 Organizacao (com.tomasio.projects.trainning.model.Organizacao)77 ArrayList (java.util.ArrayList)57 Criteria (org.hibernate.Criteria)51 Pessoa (com.tomasio.projects.trainning.model.Pessoa)46 IndicacaoDAO (com.tomasio.projects.trainning.dao.IndicacaoDAO)37 OrganizacaoDTO (com.tomasio.projects.trainning.dto.OrganizacaoDTO)37 TurmaEfetiva (com.tomasio.projects.trainning.model.TurmaEfetiva)33 PreMatriculaDAO (com.tomasio.projects.trainning.dao.PreMatriculaDAO)32 PreMatricula (com.tomasio.projects.trainning.model.PreMatricula)30 StatusTurmaEfetiva (com.tomasio.projects.trainning.model.StatusTurmaEfetiva)30 Matricula (com.tomasio.projects.trainning.model.Matricula)29 SimpleDateFormat (java.text.SimpleDateFormat)28 MatriculaDAO (com.tomasio.projects.trainning.dao.MatriculaDAO)26 TurmaDAO (com.tomasio.projects.trainning.dao.TurmaDAO)26