I have tried to find some sort of documentation stating exactly how much of the JPA 2.1 spec has been completed and haven't had much luck. I recently pulled down the 4.3.0.Beta5 build and attempted to work with EntityGraphs, but found that the necessary javax hint appears to not be implemented (i did a source check and saw the INFO logging indicating such). I am attempting to work with EntityGraphs to dynamically make a FetchType.LAZY field be queried eagerly (in essence a dynamic fetch join).
Here is the code I attempted to use (I actually got the example from EclipseLink, but i hate EclipseLink):
Code:
EntityGraph<SomeObject> soGraph = entityManager.createEntityGraph(SomeObject.class);
soGraph.addAttributeNodes(eagerFields);
Query soQuery = entityManager.createQuery("select so from SomeObject so where so.fieldOne=:fieldOne");
soQuery.setParameter("fieldOne", fieldOne);
soQuery.setHint("javax.persistence.fetchgraph", soGraph);
List<SomeObject> someObjects = soQuery.getResultList();
The call to setHint logs that the hint was ignored and then the EntityGraph functionality does nothing. "eagerFields" is a string array of eager fields... the result is that the eagerFields are not fetched and I get a LazyInstantiation error (expected if this fails).
So, my question is... is this functionality built in anywhere yet (an engineering build perhaps)? Am I doing this wrong (e.g. is there another way to do this)? If not, do you know when this might be part of a release? I am in the process of prototyping a future application... nothing will be released for many months, so I can certainly work with (unstable) engineering builds for what i am doing.
Thanks for the help!
-Paul