Community
Participate
Working Groups
Build Identifier: 2.2.0 When using a ReadAllQuery created by setting the example object, the QueryByExampleMechanism just compares the query class to the example object's class (line 77), without checking to see if the object is wrapped via a wrapping policy. In my application, I've set a wrapping policy for all objects coming out of the db, and if I use them without unwrapping them myself as an example in the query, the criteria building will fail and just return all results without criteria. The easy solution for me is to just unwrap it myself, but it seems like it would be easy to check for that scenario. Reproducible: Always Steps to Reproduce: 1. Customize your session by setting a wrapper policy. 2. Create a wrapped object and pass it in as an example object for the queryByExample.
Created attachment 195781 [details] proposed-patch
Comment on attachment 195781 [details] proposed-patch proposed-patch is garbage, doesn't fix the problem.
Turns out it was a combination of using proxies as wrappers and the values being retrieved from the proxy instead of the wrapped object. At the time of creating a query, there isn't a session from which to reference. So you can't figure out that there will be a wrapper policy later on. I think it will muddy the waters too much to try to bake something in that will retrieve a different referenceClass due to a wrapper policy after a session is executing the query. So it's probably best to just unwrap the object on our own before using the query by example functionality.
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Community: Please vote for this bug if it is important to you. Votes are one of the main criteria we use to determine which bugs to fix next.
Investigating
Just reread bug. Unassigning. Sorry for confusion
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink