Yes, the documentation is here:
http://code.google.com/appengine/docs/java/datastore/relationships.html#Relationships_Entity_Groups_and_Transactions
You would make the Person the parent entity, and you would define
Telephone like this?
@PersistenceCapable
public class Telephone {
private Key key;
private Person person;
}
Use a Key as the primary Key for Telephone and Person. You just have
to persist the Person first, or create a Person, attach Telephone
entities, then call pm.makePersistent() on the Person.
On Mon, Mar 22, 2010 at 6:57 AM, dreamy <[email protected]> wrote:
> I have two entity.
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Person{
> �...@primarykey
> �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> �...@extension(vendorName="datanucleus", key="gae.encoded-pk",
> value="true")
> private String person_id;
> }
>
> public class Telephone{
> �...@primarykey
> �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> �...@extension(vendorName="datanucleus", key="gae.encoded-pk",
> value="true")
> private String telephone_id;
>
> �...@persistent
> private String person_id; //this field point to Person
> }
> Person Module manager Person create/update/delete/query
> Telephone module manaer telephone create/update/delete/query
>
> Person can have 0 or mulity telephone but telephone only point to one
> person or Telephone.person_id=null
>
> Now there is a third module manager relation of Person and
> Telephone .
>
> if person have telephone( telephone1,telephone2,telephone3) and user
> update person's telephone is telephone2,telephone3,telephone4, how
> to implements this?
>
> is there and code example? thants a lot
>
> --
> 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.
>
>
--
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 [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.