Andrus Adamchik created CAY-2778:
------------------------------------

             Summary: Inheritance: queries on superclass should support 
subclass prefetches
                 Key: CAY-2778
                 URL: https://issues.apache.org/jira/browse/CAY-2778
             Project: Cayenne
          Issue Type: Improvement
    Affects Versions: 4.2.RC1
            Reporter: Andrus Adamchik
             Fix For: 5.0.M1
         Attachments: diff.txt

For an entity inheritance hierarchy, fetching on superclass should allow 
prefetches on subclasses. Semantically they can be resolved as DbRelationships, 
and the results can be applied only to the right subclasses.

E.g. in our unit tests (where somewhat weirdly, User inherits from Role), the 
following code throws, while it should succeed (see attached patch with a full 
test) :

{noformat}
ObjectSelect.query(Role.class)
   .prefetch(User.USER_PROPERTIES.joint())
   .select(context)
{noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to