I think korey_sed wanted to share knowledge base on his hand on experience,
his example should work...
The point in his example is querying with key, whether it's in child on
parent or child class
http://gae-java-persistence.blogspot.com/2010/01/querying-with-key-parameters.html

Obviously loading a patent class should work, but in case you have many
"deleted" Person, is it a waste (serialization)?

On Fri, Apr 30, 2010 at 8:14 PM, ailinykh <[email protected]> wrote:

> JDO is a thin layer which gives you some kind of automation and
> restriction.
> But it exists only an run time. I mean you have to instantiate objects
> first. In other words
> Company c = getCompany();
> for(Person p:c.getPersons()){
>   if(p.isDeleted())
>      continue;
>  //do what ever you want to do
> }
>
>
>
> On Apr 29, 1:15 pm, korey_sed <[email protected]> wrote:
> > I struggled with this for a while and could not find a clear example,
> > so I hope it helps someone out there.
> >
> > I have a company object that has employees and employees could be
> > deleted (boolean property).  So I wanted to search for all employees
> > for company X where the company is not deleted.  It should be noted
> > that I have a bidrectional owned relationship setup between Company
> > and Person.
> >
> > here is how I did it in JDO:
> >
> > <code>
> > Key companyKey = KeyFactory.stringToKey(companyKeyString);
> > String queryStr = "select from " + Person.class.getName() +
> >                         " where company == companyParam && deleted ==
> false";
> > Query q = pm.newQuery(queryStr);
> > q.declareVariables(Company.class.getName() + " companyParam");
> > persons = (List<Person>)q.execute(companyKey);
> > </code>
> >
> > --
> > 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
> [email protected].
> > To unsubscribe from this group, send email to
> [email protected]<google-appengine-java%[email protected]>
> .
> > For more options, visit this group athttp://
> groups.google.com/group/google-appengine-java?hl=en.
>
> --
> 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
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine-java%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to