java - Add new Entity to persisted Collection -
I've got the related table in multiple-to-many associations: Product * 1 - n * Inventory @Entity Public Category Products {// Identifier and Properties ... @OnTomy (fetch = fetchtype.EAGER, cascade = CascadeType.ALL) Public set & lt; Inventory & gt; GetInventories () {Return List; } Public Zero Set Inventory (set & lt; Inventory & gt; inventories) {This list = inventories; } Public Zero addInventory (Inventory Inventory) {this.inventories.add (list); Inventory.setProduct (this); }} - @Entity public category list {// identifier and property ... private product product; @ManyToOne (cascade = cascade type.all, alternative = false) public product getProduct () {return product; } Public Zero Set Product (Product Product) {this.product = Product; }} I have followed the seatement: I continue a product with a blank inventory set I Loading the product I try to update / merge the product By doing this, I get the exception: HibernateSystemExceptio...