What steps will reproduce the problem?
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Patient {

        @PrimaryKey
        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
        private Key patientID;

        @Persistent
        private String patientName;

        @ForeignKey
        @Persistent
        private Genders genderID;

        @Persistent
        private Date patientBirthDate;
}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Genders {

        @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key genderID;

        @Persistent
        private String genderText;
}
What is the expected output? What do you see instead?
I use this code:
Patient patient = new Patient("someName", pm.getObjectById(
                                        Genders.class, 7), new Date(), new );

And i got this exception:
Detected attempt to establish Patient(420) as the parent of Genders(7)
but
the entity identified by Genders(7) has already been persisted without
a
parent.  A parent cannot be established or changed once an object has
been
persisted.

What version of the product are you using? On what operating system?
Eclipse

Please provide any additional information below.
Please help to solve this problem

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

Reply via email to