Author: amarkhel
Date: 2009-04-24 14:51:58 -0400 (Fri, 24 Apr 2009)
New Revision: 13843
Modified:
trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java
trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java
Log:
Modified:
trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java
===================================================================
---
trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java 2009-04-24
18:40:03 UTC (rev 13842)
+++
trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java 2009-04-24
18:51:58 UTC (rev 13843)
@@ -83,7 +83,6 @@
@Fetch(FetchMode.SUBSELECT)
private List<Image> images = new ArrayList<Image>();
- @NotNull
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "SHELF_ID", nullable = false)
@ForeignKey(name = "FK_SHELF_ID")
Modified:
trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java
===================================================================
---
trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java 2009-04-24
18:40:03 UTC (rev 13842)
+++
trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java 2009-04-24
18:51:58 UTC (rev 13843)
@@ -25,6 +25,8 @@
*/
package org.richfaces.photoalbum.domain;
+import org.hibernate.annotations.Fetch;
+import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import org.hibernate.annotations.OrderBy;
@@ -163,6 +165,7 @@
CascadeType.ALL}, fetch = FetchType.LAZY)
@LazyCollection(LazyCollectionOption.EXTRA)
@OrderBy(clause = "date asc")
+ @Fetch(FetchMode.SUBSELECT)
private List<Comment> comments = new ArrayList<Comment>();
@ManyToOne(fetch = FetchType.LAZY)
Show replies by date