Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Using a fetch group with find(Fetch groups and the entity manager's find operation)
Using a fetch group with find [message #632653] Wed, 13 October 2010 17:36 Go to next message
Chris  is currently offline Chris Friend
Messages: 2
Registered: October 2010
Junior Member
I'm using eclipselink 2.0 and I can't figure out how to add a fetch group to a find.

I'm calling:
myEntityManger.find(MyTable.class, idMyTble);

Doing a normal named query I can set a fetch group with the hint method...but I don't see how to set the fetch group with the find.
Any insight would be most appreciated.
Re: Using a fetch group with find [message #632873 is a reply to message #632653] Thu, 14 October 2010 14:34 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1300
Registered: July 2009
Senior Member

Try the new to JPA find methods that take map of properties, for example:
FetchGroup fg = new FetchGroup();
HashMap properties = new HashMap(1);
properties.put(QueryHints.FETCH_GROUP, fg);
Employee resultEmployee = em.find(Employee.class, id, properties);

Best Regards,
Previous Topic:em.remove throws exception: identifier is too long
Next Topic:C++ wth Msqyl-- dyld: Library not loaded: libmysqlcppconn.5.dylib.No image found
Goto Forum:

Current Time: Wed Jun 20 09:59:23 GMT 2018

Powered by FUDForum. Page generated in 0.01459 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top