Hello Everybody,
more fetchGroup woes here:
creating a dynamic fetch group works nicely
FetchGroup fetchLit = new FetchGroup();
fetchLit.addAttribute("name");
System.out.println("## fetchlit size="+fetchLit.getAttributeNames().size());
query.setHint(QueryHints.FETCH_GROUP, fetchLit);
and delivers the expected result.
## fetchlit size=1
[EL Fine]: sql: Connection(3823508)--SELECT refIdReference, refReferenceName FROM tReferences WHERE ...
a full fetchGroup however is impossible to create:
FetchGroupManager fgm = new FetchGroupManager();
FetchGroup full =fgm.createFullFetchGroup();
System.out.println("## full size="+full.getAttributeNames().size());
query.setHint(QueryHints.FETCH_GROUP, full);
resulting in following error:
Exception in thread "main" java.lang.NullPointerException
at org.eclipse.persistence.descriptors.FetchGroupManager.createFullFetchGroup(FetchGroupManager.java:326)
at test_hannes.test_different_queries.test_criteria_relation(test_different_queries.java:130)
at test_hannes.test_different_queries.main(test_different_queries.java:43)
what am I doing wrong?
Hannes
[Updated on: Thu, 25 July 2013 05:49]
Report message to a moderator