Hello

I have two entity :

@Entity
public class City implements Serialiuzable
{
  @Id
  @GeneratedValue(strategy=GenerationType.IDENTITY)
  private Key gk_key;
  
  @Basic
  private String gs_city;
  @Basic
  private String gs_postalCode;
...
}
I create all city for belgium (2500 entity)

My seconde entity : 
@Entity
@Table(uniqueConstraints = { 
    @UniqueConstraint(columnNames = { "gs_idGoogle", "gs_pseudo" }) })
public class User implements Serializable
{

  @Id
  @GeneratedValue(strategy=GenerationType.IDENTITY)
  private Key gk_key;

...
  @ManyToOne 
  @JoinTable(name = "USER_CITY")
  @JoinColumn(name = "gk_city")
  private City go_city;
...
}

When I create (em.persist) or modify (em.merge) an entity User, I have this 
Exception
A parent cannot be established or changed once an object has been persisted.

I use JPA

Thank you and sorry for my english

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/PKGZidSDnQYJ.
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?hl=en.

Reply via email to