[appengine-java] Owned One-to-Many Relationships - query/filter on the associated/child object?

2010-02-08 Thread ChrisDane
Hi there,

How would you query/filter on ContactInfo when you have the Employee.
Or better sample if it was "Box" and a "Items", where you only want
the yellow items.

From:
http://code.google.com/appengine/docs/java/datastore/relationships.html#Unowned%5FRelationships

### Employee.java
import java.util.List;

// ...
@Persistent(mappedBy = "employee")
private List contactInfoSets;


### ContactInfo.java
import Employee;

// ...
@Persistent
private Employee employee;





Thanks!

-- 
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.



Re: [appengine-java] Owned One-to-Many Relationships - query/filter on the associated/child object?

2010-02-11 Thread Ikai L (Google)
It sounds like what you want to do here is an ancestor query:

http://groups.google.com/group/google-appengine-java/browse_thread/thread/6de4dfe44f0d0f11/f45729dfe28c9425?lnk=gst

"Items"
should be in the same entity group with Box as a parent.

On Mon, Feb 8, 2010 at 3:39 PM, ChrisDane  wrote:

> Hi there,
>
> How would you query/filter on ContactInfo when you have the Employee.
> Or better sample if it was "Box" and a "Items", where you only want
> the yellow items.
>
> From:
>
> http://code.google.com/appengine/docs/java/datastore/relationships.html#Unowned%5FRelationships
>
> ### Employee.java
> import java.util.List;
>
> // ...
>@Persistent(mappedBy = "employee")
>private List contactInfoSets;
>
>
> ### ContactInfo.java
> import Employee;
>
> // ...
>@Persistent
>private Employee employee;
>
>
>
>
>
> Thanks!
>
> --
> 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.
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
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.