Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » QueryRedirector problem (Bug/JPA)
QueryRedirector problem (Bug/JPA) [message #382540] Fri, 17 October 2008 09:29 Go to next message
Richard Eckart is currently offline Richard EckartFriend
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
Re: QueryRedirector problem (Bug/JPA) [message #382543 is a reply to message #382540] Fri, 17 October 2008 13:31 Go to previous messageGo to next message
Gordon Yorke is currently offline Gordon YorkeFriend
Messages: 78
Registered: July 2009
Member
If you migrate to EclipseLink 1.0.1 you will be able to set a default
redirector on the Entity that will be invoked for all queries on that
Entity. Look at @QueryRedirectors annotation.
--Gordon
Re: QueryRedirector problem (Bug/JPA) [message #382545 is a reply to message #382543] Fri, 17 October 2008 14:29 Go to previous messageGo to next message
Richard Eckart is currently offline Richard EckartFriend
Messages: 11
Registered: July 2009
Junior Member
Hi Gordon,

as a matter of fact we are using EclipseLink 1.0.1. As far as we can
tell after stepping through the code, what the @QueryRedirectors
annotation documentation tells us is not what is acutally happening.

Richard


Gordon Yorke schrieb:
> If you migrate to EclipseLink 1.0.1 you will be able to set a default
> redirector on the Entity that will be invoked for all queries on that
> Entity. Look at @QueryRedirectors annotation.
> --Gordon
>
Re: QueryRedirector problem (Bug/JPA) [message #382763 is a reply to message #382545] Mon, 20 October 2008 18:24 Go to previous message
Gordon Yorke is currently offline Gordon YorkeFriend
Messages: 78
Registered: July 2009
Member
Richard,
I am unable to reproduce your problems with the redirectors. I have
default redirectors configured and queries are being redirected to these
classes. EntityManager.find() is being redirected as are mapping queries.
With the EntityManager.find() is it possible you are getting a cache hit
and no query is being executed?

Can you provide a simple testcase?
--Gordon
Previous Topic:DescriptorEventAdapter merging and object
Next Topic:a custom number class
Goto Forum:
  


Current Time: Thu Apr 25 12:20:15 GMT 2024

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

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

Back to the top