5 Replies Latest reply on Aug 6, 2009 8:15 PM by Daniel Hinojosa

    ManyToOne Unidirectional relationship and merge vs. flush

    Daniel Hinojosa Master

      Do you find that when you use flush with an entity that has a @ManyToOne unidirectional relationship with another entity you end up with javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: <bean-name of entity that the entity you are flushing is related to>?

      Some other references to this problem:

      If you do, do you choose to merge(), or do you choose to change your relationships?