public List<SchoolDTO> getSchoolList() throws FortuneEnterpriseException {
List<School> listSchools=new ArrayList<School>();
List<SchoolDTO> dto = null;
SchoolMapper sMapper =new SchoolMapper();
try{
Query query=entityManager.createNamedQuery("SELECT e FROM School e");
listSchools=query.getResultList();
dto= new ArrayList<SchoolDTO>();
for (School school : listSchools) {
dto.add(sMapper.mapToDTO(school));
}
return dto;
}catch(Exception ex){
ex.printStackTrace();
throw new FortuneEnterpriseException("appplication.error");
}
}
Error: 13:15:01,845 ERROR [stderr] (default task-21) java.lang.IllegalArgumentException: No query defined for that name [SELECT e FROM School e]
Tell me my mistake.
this line is wrong:
should be: