Author: amarkhel
Date: 2009-04-07 12:13:30 -0400 (Tue, 07 Apr 2009)
New Revision: 13412
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ShelfAction.java
trunk/test-applications/realworld2/ejb/src/main/resources/import.sql
Log:
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
===================================================================
---
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2009-04-07
16:13:24 UTC (rev 13411)
+++
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2009-04-07
16:13:30 UTC (rev 13412)
@@ -76,7 +76,7 @@
),
@NamedQuery(
name = "user-shelves",
- query = "select distinct s from Shelf s where s.shared = true or s.owner
= :user order by s.name"
+ query = "select distinct s from Shelf s where (s.shared = true and
s.preDefined = true) or s.owner = :user order by s.name"
),
@NamedQuery(
name = "tag-suggest",
@@ -112,7 +112,6 @@
private String name;
@Transient
- //TODO nick - remove this
private boolean covering;
@Column(length = 1024, nullable = false)
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java
===================================================================
---
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java 2009-04-07
16:13:24 UTC (rev 13411)
+++
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java 2009-04-07
16:13:30 UTC (rev 13412)
@@ -64,8 +64,28 @@
@Temporal(TemporalType.TIMESTAMP)
private Date created;
+
+ private boolean preDefined;
/**
+ * Getter for property preDefined
+ *
+ * @return is this shelf is predefined
+ */
+ public boolean isPreDefined() {
+ return preDefined;
+ }
+
+ /**
+ * Setter for property preDefined
+ *
+ * @param preDefined
+ */
+ public void setPreDefined(boolean preDefined) {
+ this.preDefined = preDefined;
+ }
+
+ /**
* Getter for property id
*
* @return id of album
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ShelfAction.java
===================================================================
---
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ShelfAction.java 2009-04-07
16:13:24 UTC (rev 13411)
+++
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ShelfAction.java 2009-04-07
16:13:30 UTC (rev 13412)
@@ -82,7 +82,7 @@
}
/**
- * Return list of shared shelfs and if user is logged all user's shelfs
+ * Return list of shared shelfs(pre-defined) and if user is logged all user's
shelfs
* @param shelf - shelf to Synchronize
*/
@SuppressWarnings("unchecked")
Modified: trunk/test-applications/realworld2/ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/resources/import.sql 2009-04-07
16:13:24 UTC (rev 13411)
+++ trunk/test-applications/realworld2/ejb/src/main/resources/import.sql 2009-04-07
16:13:30 UTC (rev 13412)
@@ -2,10 +2,10 @@
INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate,
sex, hasAvatar) VALUES (2, 'Nick', 'Curtis',
'nkurtis(a)iba.com', 'Viking',
'8cb2237d0679ca88db6464eac60da96345513964', '1978-01-08', 1, 0);
INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate,
sex, hasAvatar) VALUES (3, 'John', 'Smith',
'jsmith(a)jboss.com', 'Noname',
'8cb2237d0679ca88db6464eac60da96345513964', '1970-01-08', 1, 0);
-INSERT INTO shelves(shelf_id, name, description, user_id, created, shared) VALUES (1,
'Nature', 'Nature pictures', 1, '2009-12-18', true);
-INSERT INTO shelves(shelf_id, name, description, user_id, created, shared) VALUES (2,
'Sport', 'Nature pictures', 1, '2009-12-18', true);
-INSERT INTO shelves(shelf_id, name, description, user_id, created, shared) VALUES (3,
'Water', 'Nature pictures', 2, '2009-12-18', true);
-INSERT INTO shelves(shelf_id, name, description, user_id, created, shared) VALUES (4,
'Flowers', 'Nature pictures', 3, '2009-12-18', true);
+INSERT INTO shelves(shelf_id, name, description, user_id, created, shared, preDefined)
VALUES (1, 'Nature', 'Nature pictures', 1, '2009-12-18', true,
true);
+INSERT INTO shelves(shelf_id, name, description, user_id, created, shared, preDefined)
VALUES (2, 'Sport', 'Nature pictures', 1, '2009-12-18', true,
true);
+INSERT INTO shelves(shelf_id, name, description, user_id, created, shared, preDefined)
VALUES (3, 'Water', 'Nature pictures', 2, '2009-12-18', true,
true);
+INSERT INTO shelves(shelf_id, name, description, user_id, created, shared, preDefined)
VALUES (4, 'Flowers', 'Nature pictures', 3, '2009-12-18', true,
true);
---------------------------------------------------------------------
-- ALBUM - Animals