Sorry, I am unable to attach patched test case. So I add in only in text.
-
-
-
Eclipse Workspace Patch 1.0
#P hibernate-core diff --git src/test/java/org/hibernate/test/ondemandload/Inventory.java src/test/java/org/hibernate/test/ondemandload/Inventory.java index 494df13..b475d37 100644
-
src/test/java/org/hibernate/test/ondemandload/Inventory.java
+++ src/test/java/org/hibernate/test/ondemandload/Inventory.java @@ -36,7 +36,7 @@ @Entity public class Inventory { private int id = -1; - private Store store; + //private Store store; private Product product; private Long quantity; private BigDecimal storePrice; @@ -45,7 +45,7 @@ }
public Inventory(Store store, Product product) { - this.store = store; + //this.store = store; this.product = product; }
@@ -60,7 +60,7 @@ this.id = id; }
@ManyToOne @JoinColumn( name = "prod_id" ) diff --git src/test/java/org/hibernate/test/ondemandload/Store.java src/test/java/org/hibernate/test/ondemandload/Store.java index d2c1eb1..ba154d6 100644 — src/test/java/org/hibernate/test/ondemandload/Store.java +++ src/test/java/org/hibernate/test/ondemandload/Store.java @@ -68,7 +68,8 @@ return this; }
-
@OneToMany(mappedBy = "store", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ //@OneToMany(mappedBy = "store", cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true) public List<Inventory> getInventories() { return inventories; }
|