use of com.tomasio.projects.trainning.model.Posto in project trainning by fernandotomasio.
the class OrganizationalServiceSimpleImpl method findAllPostos.
@Override
@Transactional(readOnly = true)
public PostoDTO[] findAllPostos() {
PostoDAO dao = factory.getPostoDAO();
PostoDTO[] postosArray = null;
try {
List<Posto> postos = dao.findAll();
postosArray = new PostoDTO[postos.size()];
for (int i = 0; i < postosArray.length; i++) {
postosArray[i] = postos.get(i).createDTO();
}
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
}
return postosArray;
}
Aggregations