String query = ("select from "+Symptom.class.getName()+" where teste == "+hehe+"");
List<Symptom> listSym = (List<Symptom>)pm.newQuery(query).execute();
List<Symptom> listSt = new ArrayList<Symptom>();
if (!listSym.isEmpty()) {
Symptom esp = symptomRep.search(listSym.get(0).getId());
listSt.add(esp);
try {
listSym.remove(0);
} catch (UnsupportedOperationException uoe) {
listSym = new ArrayList<Symptom>(listSym);
listSym.remove(0);
}
} else {
//throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
}
while(!listSym.isEmpty()){
Symptom ms = symptomRep.search(listSym.get(0).getId());
listSt.add(ms);
listSym.remove(0);
}