Hello!

I have a @PersistenceCapable _abstract_ class ParentEntity, and a
PersistenceCapable derived class ChildEntity. The Parent class has a
field "s_name".

I created and saved a ChildEntity with s_name "foo".

When I do

            query = pm.newQuery( ParentEntity.class );
            query.setFilter( "s_name == s" );
            query.declareParameters("String s");

            @SuppressWarnings("unchecked")
            List<ParentEntity> results =
                (List<ParentEntity>) query.execute("foo");

I receive an empty list. When I do

            query = pm.newQuery( ChildEntity.class );
            query.setFilter( "s_name == s" );
            query.declareParameters("String s");

            @SuppressWarnings("unchecked")
            List<ChildEntity> results =
                (List<ChildEntity>) query.execute("foo");

I get a list with my entity.

Question: is this "by design"? Is there a way to query for
ParentEntities and receive all entities (potentially of different
kinds) of derived classes that match the filter? If not, then what is
the use case of the currently supported flavor of inheritance
(complete-table/subclass-table)?

Thanks,
MG

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to