i got the named query bellow and it is not return anything when a execute a command such as query.list(). When i execute the generated query on my DB (Oracle 10g), it runs without any problems.
Code:
"from Question q where q.informy = :informy"
but when i remove the filter, it works perfectly
Code:
"from Question"
'informy' is an entity (should i'd used Informy - capital 'I'), and i have a unidirectional relation from Question
Code:
Class Question
          ...
          // INFORMY_ID is a FK in Question table and the PK of Informy
          @ManyToOne
          @JoinColumn(name="INFORMY_ID")
          private Informy informy
on the DAO ive got:
Code:
Query query = getSession().getNamedQuery("CheckQuestion").setEntity("informy", question.getInformy());
List questions = query.list();
// questions.size() returns 0
i searched over the internet and read a few books i have, but no clue. Any ideas where the problem may be? Even when ive changed to native sql, it is not working.
Anyway, tonight im going to struggle a lil bit more.
cya