File tree Expand file tree Collapse file tree 4 files changed +25
-0
lines changed
src/com/arm/nimbus/collab/server/model Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -64,4 +64,14 @@ public Product persist() {
6464 public void remove () {
6565 EntityManager .getInstance ().getDs ().delete (this );
6666 }
67+
68+ /**
69+ * This field is mandatory !
70+ * http://stackoverflow.com/questions/6295567/gwt-app-cannot-find-matching-method-from-my-requestcontext-interface
71+ * @param id
72+ * @return
73+ */
74+ public static Product findProduct (String id ) {
75+ return EntityManager .getInstance ().getDs ().find (Product .class , "id" , id ).get ();
76+ }
6777}
Original file line number Diff line number Diff line change 11package com .arm .nimbus .collab .server .model ;
22
33import com .arm .nimbus .collab .client .model .ReviewProxy ;
4+ import com .arm .nimbus .collab .server .EntityManager ;
45
56import javax .validation .constraints .NotNull ;
67
@@ -57,4 +58,8 @@ public String getNote() {
5758 public void setNote (String note ) {
5859 this .note = note ;
5960 }
61+
62+ public static Review findReview (String id ) {
63+ return EntityManager .getInstance ().getDs ().find (Review .class , "id" , id ).get ();
64+ }
6065}
Original file line number Diff line number Diff line change 11package com .arm .nimbus .collab .server .model ;
22
3+ import com .arm .nimbus .collab .server .EntityManager ;
34import com .google .code .morphia .annotations .Embedded ;
45import com .google .code .morphia .annotations .Entity ;
56
@@ -73,5 +74,9 @@ public void setProductID(String productID) {
7374 public static List <Task > findByUser (String userID ){
7475 return null ;
7576 }
77+
78+ public static Task findTask (String id ){
79+ return EntityManager .getInstance ().getDs ().find (Task .class , "id" , id ).get ();
80+ }
7681
7782}
Original file line number Diff line number Diff line change 11package com .arm .nimbus .collab .server .model ;
22
3+ import com .arm .nimbus .collab .server .EntityManager ;
34import com .google .code .morphia .annotations .Entity ;
45
56import javax .validation .constraints .NotNull ;
@@ -38,4 +39,8 @@ public String getRole() {
3839 public void setRole (String role ) {
3940 this .role = role ;
4041 }
42+
43+ public static User findUser (String id ){
44+ return EntityManager .getInstance ().getDs ().find (User .class , "id" , id ).get ();
45+ }
4146}
You can’t perform that action at this time.
0 commit comments