[seam-commits] Seam SVN: r7520 - trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Mar 10 10:57:10 EDT 2008


Author: christian.bauer at jboss.com
Date: 2008-03-10 10:57:10 -0400 (Mon, 10 Mar 2008)
New Revision: 7520

Modified:
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiDirectory.java
Log:
JBSEAM-2707, Hibernate ignores NO_PROXY in subclass

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiDirectory.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiDirectory.java	2008-03-08 03:11:41 UTC (rev 7519)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiDirectory.java	2008-03-10 14:57:10 UTC (rev 7520)
@@ -13,17 +13,20 @@
 @Entity
 @Table(name = "WIKI_DIRECTORY")
 @org.hibernate.annotations.ForeignKey(name = "FK_WIKI_DIRECTORY_NODE_ID")
-//TODO: @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE)
 public class WikiDirectory extends WikiNode<WikiDirectory> implements NestedSetNode<WikiDirectory>, Serializable {
 
     @Column(name = "DESCRIPTION", nullable = true)
     @Length(min = 0, max = 512)
     private String description;
 
-    @ManyToOne(fetch = FetchType.LAZY)
+// This does not work, as usual. Hibernate just ignores it and gives me a proxy sometimes, leading to CCE later on
+// Maybe because I query directories with "from WikiNode where parentId", so the instrumentation of the WikiDirectory
+// subclass has no effect. 
+//    @ManyToOne(fetch = FetchType.LAZY)
+//    @org.hibernate.annotations.LazyToOne(org.hibernate.annotations.LazyToOneOption.NO_PROXY)
+    @ManyToOne(fetch = FetchType.EAGER)
     @JoinColumn(name = "DEFAULT_FILE_ID", nullable = true, unique = true)
     @org.hibernate.annotations.ForeignKey(name = "FK_WIKI_DIRECTORY_DEFAULT_FILE_ID")
-    @org.hibernate.annotations.LazyToOne(org.hibernate.annotations.LazyToOneOption.NO_PROXY)
     private WikiFile defaultFile;
 
     @OneToOne(fetch = FetchType.EAGER, mappedBy = "directory", cascade = CascadeType.PERSIST)




More information about the seam-commits mailing list