Based on the example in the "Creating Entities With Entity Groups"
section of
http://code.google.com/appengine/docs/java/datastore/transactions.html#Using_Transactions
1.
KeyFactory.Builder keyBuilder = new
KeyFactory.Builder(Customer.class.getSimpleName(), "custid985135");
Key parentKey = keyBuilder.getKey();
keyBuilder.addChild(AccountInfo.class.getSimpleName(),
"acctidX142516");
Key key = keyBuilder.getKey();
Customer cust = new Customer ();
cust.setKey(parentKey);
AccountInfo acct = new AccountInfo();
acct.setKey(key);
pm.makePersistentAll(cust, acct);
2
Key parentKey = KeyFactory.createKey
(Customer.class.getSimpleName(), "custid985135");
Key key = KeyFactory.createKey (parentKey,
AccountInfo.class.getSimpleName(), "acctidX142516");
Customer cust = new Customer ();
cust.setKey(parentKey);
AccountInfo acct = new AccountInfo();
acct.setKey(key);
pm.makePersistentAll(cust, acct);
--
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.