[appengine-java] Re: many to many relation with additional attribut

2010-06-08 Thread wilberforce
I have used the above mentioned solution for my many to many relations. Now if I want to get all the entities of type Entity2 for one entity of type Entity1 I query the ManyToManyLink with the key of Entity1. As a result I get a list of keys for Entity2. Now how do I query Entity2 to get all the

[appengine-java] Re: many to many relation with additional attribut

2010-06-08 Thread Ian Marshall
You might want to try one of the javax.​jdo.​PersistenceManager.getObjectsById(...) methods. I have not done this myself yet (although I do use getObjectById(...)), so I have not used an array or collection of OIDs. You might want to give this a try. Failing that, you might want to have as an

[appengine-java] Re: many to many relation with additional attribut

2010-06-08 Thread Anna
Thanks a lot for your helpful code Ian! Now I've implemented the long as gae.pk-id. Both entities and the link are stored but I don't know how to adopt what you wrote: On 7 Jun., 21:54, Ian Marshall ianmarshall...@gmail.com wrote: Beware that in this case, the Long ID values are not the full

[appengine-java] Re: many to many relation with additional attribut

2010-06-08 Thread Anna
Thanks a lot for your helpful code Ian! Now I've implemented the long as gae.pk-id. Both entities and the link are stored but I don't know how to adopt what you wrote: On 7 Jun., 21:54, Ian Marshall ianmarshall...@gmail.com wrote: Beware that in this case, the Long ID values are not the full

[appengine-java] Re: many to many relation with additional attribut

2010-06-08 Thread Anna
Thanks a lot for your helpful code Ian! Now I've implemented the long as gae.pk-id. Both entities and the link are stored but I don't know how to adopt what you wrote: On 7 Jun., 21:54, Ian Marshall ianmarshall...@gmail.com wrote: Beware that in this case, the Long ID values are not the full

[appengine-java] Re: many to many relation with additional attribut

2010-06-08 Thread Ian Marshall
How do I build a key from parent and child if I don't know the parent's key? I use a field to link the entity group parent instance to a child instance. I make this bi-directional, so from an entity I can retrieve both its parent and also its child or set of children. Thanks a lot for your

[appengine-java] Re: many to many relation with additional attribut

2010-06-07 Thread Anna
Thank you very much Ian! I've implemented your solution but now I struggle with adding a Link to the database: A record of entity 1 and one of entity 2 are stored in the database. How can I get them out of the database to put their keys into a new link? I don't know the keys of both entities