| QueryRedirector problem (Bug/JPA) [message #382540] |
Fri, 17 October 2008 05:29  |
Richard Eckart Messages: 11 Registered: July 2009 |
Junior Member |
|
|
Hello everybody,
we are trying to use the QueryRedirector feature of EclipseLink to
realize partially loaded entities. Imagine we have an entity type A
which has a OneToMany relation to a type B. Now we want to load A so
that only those dependend B are loaded that match a certain criteria.
There are two problems involved in this:
a) QueryRedirectors do not work if we use the JPA EntityManager.find()
method, though the JavaDoc for the QueryRedirectors state that a
ReadObject redirector should be invoked.
We assume this is a bug. EntityManagerImpl.findInternal() does not
set a redirector on the created query. Probably this has been
forgotten as the JavaDoc clearly states that it should set the
redirector.
b) We also configured redirectors on the type B expecting that when
EclipseLink loads the B entites related to A, a readAll redirector
should be invoked. This however is not the case, so that we cannot
intercept and modify the query loading of the related B entities.
Do we misunderstand the concept of redirectors here? Shouldn't they
also be able to intercept the loading of related entities? May this
also be a bug?
Best regards,
Richard
|
|
|