use of com.tomasio.projects.trainning.model.ConsultaInstrutor in project trainning by fernandotomasio.
the class InstructorsServiceSimpleImpl method findAllConsultaInstrutorByRemetenteId.
@Override
@Transactional(readOnly = true)
public ConsultaInstrutorDTO[] findAllConsultaInstrutorByRemetenteId(Long remetenteId, boolean finalizado) {
ConsultaInstrutorDAO dao = factory.getConsultaInstrutorDAO();
ConsultaInstrutorDTO[] consultasArray = null;
try {
List<ConsultaInstrutor> consultas = dao.findAllByRemetenteId(remetenteId, finalizado);
if (consultas != null) {
consultasArray = new ConsultaInstrutorDTO[consultas.size()];
for (int i = 0; i < consultas.size(); i++) {
consultasArray[i] = consultas.get(i).createDTO();
}
}
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
}
return consultasArray;
}
use of com.tomasio.projects.trainning.model.ConsultaInstrutor in project trainning by fernandotomasio.
the class InstructorsServiceSimpleImpl method updateConsultaInstrutor.
@Override
@Transactional
public void updateConsultaInstrutor(ConsultaInstrutorDTO consultaInstrutor) {
ConsultaInstrutorDAO dao = factory.getConsultaInstrutorDAO();
ConsultaInstrutor model = new ConsultaInstrutor(consultaInstrutor);
update(dao, model);
}
use of com.tomasio.projects.trainning.model.ConsultaInstrutor in project trainning by fernandotomasio.
the class InstructorsServiceSimpleImpl method createConsultaInstrutor.
@Override
@Transactional
public Long createConsultaInstrutor(ConsultaInstrutorDTO consultaInstrutor) {
ConsultaInstrutorDAO dao = factory.getConsultaInstrutorDAO();
ConsultaInstrutor model = new ConsultaInstrutor(consultaInstrutor);
return create(dao, model);
}
use of com.tomasio.projects.trainning.model.ConsultaInstrutor in project trainning by fernandotomasio.
the class InstructorsServiceSimpleImpl method findConsultaInstrutor.
@Override
@Transactional(readOnly = true)
public ConsultaInstrutorDTO findConsultaInstrutor(Long id) {
ConsultaInstrutorDAO dao = factory.getConsultaInstrutorDAO();
ConsultaInstrutor consulta = (ConsultaInstrutor) find(dao, id);
if (consulta != null) {
return consulta.createDTO();
} else {
return null;
}
}
use of com.tomasio.projects.trainning.model.ConsultaInstrutor in project trainning by fernandotomasio.
the class InstructorsServiceSimpleImpl method findAllConsultaInstrutorByTurmaId.
@Override
@Transactional(readOnly = true)
public ConsultaInstrutorDTO[] findAllConsultaInstrutorByTurmaId(Long turmaId) {
ConsultaInstrutorDAO dao = factory.getConsultaInstrutorDAO();
ConsultaInstrutorDTO[] consultasArray = null;
try {
List<ConsultaInstrutor> consultas = dao.findAllByTurmaId(turmaId);
if (consultas != null) {
consultasArray = new ConsultaInstrutorDTO[consultas.size()];
for (int i = 0; i < consultas.size(); i++) {
consultasArray[i] = consultas.get(i).createDTO();
}
}
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
}
return consultasArray;
}
Aggregations