Typed query hints [message #1090993] |
Tue, 20 August 2013 19:27  |
Eclipse User |
|
|
|
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));
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08322 seconds