Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Typed query hints
Typed query hints [message #1090993] Tue, 20 August 2013 23:27 Go to next message
Roger Spall is currently offline Roger SpallFriend
Messages: 17
Registered: January 2013
Junior Member
I'm loving CriteriaBuilders and the Entity metadata for strongly typed queries...

Anyway, is there any way to use the same strong typing for specifying query hints?

For example, I want to add a batch read hint using a Typed field, so instead of:

               final TypedQuery<TechnicalPublicationType> readAllQuery = ydsusEntityManager.createQuery("select o from TechnicalPublicationType o", TechnicalPublicationType.class);
                readAllQuery.setHint("eclipselink.batch", "o.categories");


I want to do something like:

                final CriteriaBuilder builder = ydsusEntityManager.getCriteriaBuilder();
                final CriteriaQuery<TechnicalPublicationType> query = builder.createQuery(TechnicalPublicationType.class);
                final Root<TechnicalPublicationType> from = query.from(TechnicalPublicationType.class);
                final TypedQuery<TechnicalPublicationType> readAllQuery = ydsusEntityManager.createQuery(query);
                readAllQuery.setHint("eclipselink.batch", from.get(TechnicalPublicationType_.categories));
Re: Typed query hints [message #1096573 is a reply to message #1090993] Wed, 28 August 2013 15:29 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

No, hints only use string.

James : Wiki : Book : Blog : Twitter
Re: Typed query hints [message #1106198 is a reply to message #1096573] Tue, 10 September 2013 20:39 Go to previous message
Roger Spall is currently offline Roger SpallFriend
Messages: 17
Registered: January 2013
Junior Member
Feature request Smile

I guess this would be the JPA standards committee!
Previous Topic:Composite Primary key error - Multiple writable mappings exist for the field
Next Topic:JPA hierarchical queries
Goto Forum:
  


Current Time: Tue Apr 16 19:15:57 GMT 2024

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

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

Back to the top