Hi Mario,
the query key has to be defined on Partner pointing to Employee instead of Role. Please have a look at
http://code.google.com/p/oopex/source/browse/trunk/modules/eclipselink1-jpa/src/queries-downcasts/java/oopex/eclipselink1/jpa/queries/DowncastsMain.java#139. I never tried this for defining Join-Reads/Batch-Reads, though.
@Tom: Using downcasts in queries is, from my point of view, something quite natural if you design your model in a truly object oriented way. Reiterating that this feature nobody is needing, does not make disappear. The other feature, Mario is looking for, might be called "fetch-plans/plans" - as in the old JDO days ;-). See
http://wiki.eclipse.org/EclipseLink/Development/JPA/NestedFetchGroups, last item in the open issues list. Also this feature(-request) I see frequently in projects when there is a CRUD-style rich client.
-- Frank
Meet me at JFS2009
http://www.java-forum-stuttgart.de/
Mario Sandro Schwarz wrote: