You need to specify @Persistent(defaultFetchGroup = "true") if you want the
user to be loaded along with the Customer.

Cheers,
-- 
Sébastien Tromp

2011/7/28 José Francisco <josefc...@gmail.com>

> Hi , I have the following source code:
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Customer implements IsSerializable {
>
>        @PrimaryKey
>        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>        private Long id;
>        @Persistent
>        private String name;
>        @Persistent
>        private Usuario admin;
>        .......
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Userimplements IsSerializable {
>
>        @PrimaryKey
>        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>        private Key key;
>        @Persistent
>        private String name;
>        .....
>
> and I try to save as follows:
>
>        public boolean insertCustomer(Customer c, Usuer u) {
>                PersistenceManager pm =
> PMF.getPmfInstancia().getPersistenceManager();
>                Transaction tx = pm.currentTransaction();
>                try {
>                tx.begin();
>                c.setAdmin(u);
>                pm.makePersistent(c);
>                tx.commit();
>                ....
>
> but when I retrieve data, the customer is saved but the associated
> user not. Any idea?
> Thanks.
>
> --
> 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-java@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.
>
>

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

Reply via email to