How to instert child entities in JDO (Google App Engine) ?

Posted by Kerem Pekçabuk on Stack Overflow See other posts from Stack Overflow or by Kerem Pekçabuk
Published on 2010-06-10T21:11:16Z Indexed on 2010/06/10 21:12 UTC
Read the original article Hit count: 271

Filed under:
|
|

How do i add a record to a child entity in the example below ? For example i have a Employee Record which is name is "Sam". how do i add 2 street adress for sam ?

Guess i have a

The Parent entity is Employee

import java.util.List;

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

The Child key is Adress

import com.google.appengine.api.datastore.Key; // ... imports ...

@PersistenceCapable public class ContactInfo { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key;

@Persistent
private String streetAddress;

// ...

}

© Stack Overflow or respective owner

Related posts about google-app-engine

Related posts about jdo