1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.useroptions;
17
18 import javax.persistence.Column;
19 import javax.persistence.Entity;
20 import javax.persistence.Id;
21 import javax.persistence.IdClass;
22 import javax.persistence.NamedQueries;
23 import javax.persistence.NamedQuery;
24 import javax.persistence.Table;
25 import javax.persistence.Version;
26
27 import org.kuali.rice.kew.api.preferences.Preferences;
28
29
30
31
32
33
34
35 @IdClass(org.kuali.rice.kew.useroptions.UserOptionsId.class)
36 @Entity
37 @Table(name="KREW_USR_OPTN_T")
38 @NamedQueries({
39 @NamedQuery(name="UserOptions.FindByUserQualified", query="select uo from UserOptions uo where uo.workflowId = :workflowId and uo.optionId like :optionId"),
40 @NamedQuery(name="UserOptions.FindByWorkflowId", query="select uo from UserOptions uo where uo.workflowId = :workflowId"),
41 @NamedQuery(name="UserOptions.FindByOptionValue", query="select uo from UserOptions uo where uo.optionId = :optionId and uo.optionVal = :optionValue"),
42 @NamedQuery(name="UserOptions.FindByOptionId", query="select uo from UserOptions uo where uo.optionId = :optionId and uo.workflowId = :workflowId"),
43 @NamedQuery(name="UserOptions.FindEmailUserOptionsByType", query="select uo from UserOptions uo where (uo.optionId = :optionId or uo.optionId like :optionIdLike) and uo.optionVal = :optionValue")
44 })
45 public class UserOptions implements Comparable {
46
47 @Id
48 @Column(name="PRNCPL_ID",insertable=false,updatable=false)
49 private String workflowId;
50 @Id
51 @Column(name="PRSN_OPTN_ID",insertable=false,updatable=false)
52 private String optionId;
53 @Column(name="VAL")
54 private String optionVal;
55 @Version
56 @Column(name="VER_NBR")
57 private Integer lockVerNbr;
58
59
60
61
62 public Integer getLockVerNbr() {
63 return lockVerNbr;
64 }
65
66
67
68
69 public String getOptionId() {
70 return optionId;
71 }
72
73
74
75
76 public String getOptionVal() {
77 return optionVal;
78 }
79
80
81
82
83 public String getWorkflowId() {
84 return workflowId;
85 }
86
87
88
89
90 public void setLockVerNbr(Integer integer) {
91 lockVerNbr = integer;
92 }
93
94
95
96
97 public void setOptionId(String string) {
98 optionId = string;
99 }
100
101
102
103
104 public void setOptionVal(String string) {
105 optionVal = string;
106 }
107
108
109
110
111 public void setWorkflowId(String string) {
112 workflowId = string;
113 }
114
115
116 public int compareTo(Object o) {
117 if (o instanceof UserOptions) {
118 return this.getOptionId().compareTo(((UserOptions)o).getOptionId());
119 }
120 return 0;
121 }
122 }
123