-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Hibernate JPA 2.1 Support
PostPosted: Mon Oct 28, 2013 5:45 pm 
Beginner
Beginner

Joined: Mon Nov 19, 2007 4:40 pm
Posts: 46
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

_________________
-----------------------
Paul
Software Engineer
Lockheed Martin


Top
 Profile  
 
 Post subject: Re: Hibernate JPA 2.1 Support
PostPosted: Tue Oct 29, 2013 4:32 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 18, 2012 5:03 am
Posts: 36
Location: Fort Wayne, Indiana, USA
Hey Paul. EntityGraph support is currently being worked on and should be released in 4.3.0.Beta6. EntityGraph through query hints is being developed under https://hibernate.atlassian.net/browse/HHH-8627. 4.3.0.Final isn't far away...


Top
 Profile  
 
 Post subject: Re: Hibernate JPA 2.1 Support
PostPosted: Tue Oct 29, 2013 6:55 am 
Beginner
Beginner

Joined: Mon Nov 19, 2007 4:40 pm
Posts: 46
Yes... I see the commits!!! Thank you for the response and I look forward to the release!

_________________
-----------------------
Paul
Software Engineer
Lockheed Martin


Top
 Profile  
 
 Post subject: Re: Hibernate JPA 2.1 Support
PostPosted: Wed Oct 30, 2013 12:18 pm 
Beginner
Beginner

Joined: Mon Nov 19, 2007 4:40 pm
Posts: 46
Brett,

JIRA has a release date for beta 6 of Nov 6 - there was a comment in the blog for beta 5 that indicated the original date is not likely to happen as Steve had to travel that week... do you have a new release date? We are doing sprint planning this friday and I wanted to know if i should bother tasking this effort for the next sprint.

Thanks!

_________________
-----------------------
Paul
Software Engineer
Lockheed Martin


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.