JPA: detached entity passed to persist: nested exception is org.hibernate.PersistentObjectException
问题 JPA: many-to-many connection. Scenerio: Multiple product can be saved under multiple categories. Like: Mango can be used as Fruit category and Desert Category. Product == [COMMODITY] Category == [GENRE] Exception: detached entity passed to persist: sari.core.domain.account.Genre; nested exception is org.hibernate.PersistentObjectException: detached entity passed to persist: Commodity.java: @Entity @Table(name = "COMMODITY") public class Commodity implements Serializable { @Id @Column(name =