Author | Message |
---|---|
Vanquish39
Posts: 134
|
Posted 13:13 Oct 16, 2011 |
If any of you are having problems returning a list of objects from the getResultList(), this explains a difference between 2 different implementations. Let's say you have a Patient class and inside this patient class you have a list of insurance objects.
//Querying way #1. If you don't specify select in the query, you will get back all the objects.
Query query = manager.createQuery("from Patient p join p.insurances i where i.name = :name");
Query qq = manager.createQuery("select p from Patient p join p.insurances i where i.name = :name");
If anyone was having this problem, this is probably your solution. |