[appengine-java] Re: how to build same entity group

2010-03-31 Thread dreamy
Thanks to Chau Huynh.

as you said, how to  find all  the list of   telephone( has belong to
a person )? because of these telephone can't sale again.

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



[appengine-java] Re: how to build same entity group

2010-03-31 Thread dreamy
now i have done it  by  part transaction.

use case: Person  buy three Telephone

update  Person property(and other sub class property)  ---use
transaction
update  three Telephone.person_id=person_id. not use
transaction

thanks to all

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



[appengine-java] Re: how to build same entity group

2010-03-25 Thread dreamy
for instance, you can just use a Key and reference
the Person in the Telephone.

you are right. and i just do it as you say.

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
}

my question is 
if person have telephone( telephone1,telephone2,telephone3) and user
update person's telephone is telephone2,telephone3,telephone4,how
to implements this?


but in a same  transactions , I need update 2 telephone
object .--telephone1.person_id=null
telephone4.person_id=person_id.
and the 2 telephone object is not in same entity group.


the question seem to equalhow to update  multi  object (same
class) in same transaction?


Thank you for your help

-- 
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] Re: how to build same entity group

2010-03-25 Thread Chau Huynh
As a non native English speaker also, let me guess If I got you correctly,
dreamy

You want to manipulate Telephone separately, independent of its-owner-to-be,
so you will have a Telephone class.
Similarly, you will have another class for Person.
Because there're no dependency between creating of Person and Telephone, you
will not need to put those in the same transaction (entity group, you thread
subject was a bit confused) - just check Ikai's explanation above.

Now your need to represent when user buys/exchanges some phones? Can you try
this:
class Person {

ListKey phones;
}
You might need to read relationship link above for more detail.

Thanks

On Thu, Mar 25, 2010 at 7:24 PM, dreamy dreamy2c...@gmail.com wrote:

 for instance, you can just use a Key and reference
 the Person in the Telephone.

 you are right. and i just do it as you say.

 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
 }

 my question is 
 if person have telephone( telephone1,telephone2,telephone3) and user
 update person's telephone is telephone2,telephone3,telephone4,how
 to implements this?
 

 but in a same  transactions , I need update 2 telephone
 object .--telephone1.person_id=null
 telephone4.person_id=person_id.
 and the 2 telephone object is not in same entity group.


 the question seem to equalhow to update  multi  object (same
 class) in same transaction?


 Thank you for your help

 --
 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.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.



-- 
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] Re: how to build same entity group

2010-03-24 Thread Ikai L (Google)
I'd consider why you need them in the same entity group. If you don't
need transactions, for instance, you can just use a Key and reference
the Person in the Telephone.

On Tue, Mar 23, 2010 at 6:54 PM, dreamy dreamy2c...@gmail.com wrote:
 Hello Ikai L  thanks for your reply.

 You just have  to persist the Person first, or create a Person, attach
 Telephone
 entities, then call pm.makePersistent() on the Person.
but this is problem.   Telephone must not belong to Person.
 Telephone module manaer   telephone   create/update/delete/query ,
 telphone have many active or property  to be managered and  then there
 is no idea of Person

 I need set  Telephone.person  only after  this person have buy the
 telephone.


 there is any other idea ? thanks 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 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.



[appengine-java] Re: how to build same entity group

2010-03-23 Thread dreamy
Hello Ikai L  thanks for your reply.

You just have  to persist the Person first, or create a Person, attach
Telephone
entities, then call pm.makePersistent() on the Person.
but this is problem.   Telephone must not belong to Person.
Telephone module manaer   telephone   create/update/delete/query ,
telphone have many active or property  to be managered and  then there
is no idea of Person

I need set  Telephone.person  only after  this person have buy the
telephone.


there is any other idea ? thanks 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 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.