[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model ...
Christian Bauer
christian at hibernate.org
Fri Apr 27 06:33:40 EDT 2007
User: cbauer
Date: 07/04/27 06:33:40
Modified: examples/wiki/src/main/org/jboss/seam/wiki/core/model
Document.java Node.java File.java Directory.java
Log:
Now deployable on 4.2 out-of-box (local Hibernate JARs) and optimized SQL and caching
Revision Changes Path
1.10 +1 -0 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Document.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Document.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Document.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- Document.java 26 Apr 2007 05:29:17 -0000 1.9
+++ Document.java 27 Apr 2007 10:33:40 -0000 1.10
@@ -12,6 +12,7 @@
@Column(name = "CONTENT")
@Length(min = 1, max = 32768)
@org.hibernate.search.annotations.Field(index = org.hibernate.search.annotations.Index.TOKENIZED)
+ @Basic(fetch = FetchType.LAZY) // Lazy loaded through bytecode instrumentation
private String content;
@Column(name = "NAME_AS_TITLE")
1.13 +1 -6 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Node.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Node.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Node.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- Node.java 26 Apr 2007 05:29:17 -0000 1.12
+++ Node.java 27 Apr 2007 10:33:40 -0000 1.13
@@ -73,12 +73,7 @@
@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_NODE_ID", nullable = true)
@org.hibernate.annotations.IndexColumn(name = "NODE_POSITION")
- /* Filtering fucks up the list index... big issue to work around
- @org.hibernate.annotations.Filter(
- name = "accessLevelFilter",
- condition = "READ_ACCESS_LEVEL <= :currentAccessLevel"
- )
- */
+ @org.hibernate.annotations.BatchSize(size = 5) // Helps with walking the node tree
private List<Node> children = new ArrayList<Node>();
@Column(name = "CREATED_ON", nullable = false, updatable = false)
1.7 +1 -0 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/File.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: File.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/File.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- File.java 26 Apr 2007 05:29:17 -0000 1.6
+++ File.java 27 Apr 2007 10:33:40 -0000 1.7
@@ -24,6 +24,7 @@
// SchemaExport needs length.. MySQL has "tinyblob", "mediumblob" and other such nonsense types
@Lob
@Column(table = "NODE_FILE", name = "FILEDATA", nullable = false, length = 10000000)
+ @Basic(fetch = FetchType.LAZY) // Lazy loaded through bytecode instrumentation
private byte[] data;
@Column(table = "NODE_FILE", name = "CONTENT_TYPE", length = 255)
1.7 +2 -1 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Directory.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Directory.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Directory.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- Directory.java 21 Apr 2007 08:34:36 -0000 1.6
+++ Directory.java 27 Apr 2007 10:33:40 -0000 1.7
@@ -11,7 +11,8 @@
@org.hibernate.annotations.ForeignKey(name = "FK_DIRECTORY_DEFAULT_DOCUMENT_ID")
private Document defaultDocument;
- @OneToOne(fetch = FetchType.EAGER, mappedBy = "directory", cascade = CascadeType.PERSIST)
+ @OneToOne(fetch = FetchType.LAZY, mappedBy = "directory", cascade = CascadeType.PERSIST)
+ @org.hibernate.annotations.LazyToOne(org.hibernate.annotations.LazyToOneOption.NO_PROXY)
private Feed feed;
public Directory() { super("New Directory"); }
More information about the jboss-cvs-commits
mailing list