1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.rule; |
17 | |
|
18 | |
import org.apache.commons.lang.ObjectUtils; |
19 | |
import org.hibernate.annotations.GenericGenerator; |
20 | |
import org.hibernate.annotations.Parameter; |
21 | |
import org.kuali.rice.core.framework.persistence.jpa.OrmUtils; |
22 | |
import org.kuali.rice.kew.service.KEWServiceLocator; |
23 | |
|
24 | |
import javax.persistence.*; |
25 | |
import java.io.Serializable; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
@Entity |
39 | |
@Table(name="KREW_RULE_EXT_VAL_T") |
40 | |
|
41 | |
public class RuleExtensionValue implements Serializable { |
42 | |
|
43 | |
private static final long serialVersionUID = 8909789087052290261L; |
44 | |
@Id |
45 | |
@GeneratedValue(generator="KREW_RTE_TMPL_S") |
46 | |
@GenericGenerator(name="KREW_RTE_TMPL_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters={ |
47 | |
@Parameter(name="sequence_name",value="KREW_RTE_TMPL_S"), |
48 | |
@Parameter(name="value_column",value="id") |
49 | |
}) |
50 | |
@Column(name="RULE_EXT_VAL_ID") |
51 | |
private String ruleExtensionValueId; |
52 | |
@Column(name="RULE_EXT_ID", insertable=false, updatable=false) |
53 | |
private String ruleExtensionId; |
54 | |
@Column(name="VAL") |
55 | |
private String value; |
56 | |
@Column(name="KEY_CD") |
57 | |
private String key; |
58 | |
@Version |
59 | |
@Column(name="VER_NBR") |
60 | |
private Integer lockVerNbr; |
61 | |
|
62 | |
@ManyToOne(fetch=FetchType.EAGER, cascade={CascadeType.PERSIST}) |
63 | |
@JoinColumn(name="RULE_EXT_ID") |
64 | |
private RuleExtensionBo extension; |
65 | |
|
66 | 0 | public RuleExtensionValue() { |
67 | 0 | } |
68 | |
|
69 | 0 | public RuleExtensionValue(String key, String value) { |
70 | 0 | this.key = key; |
71 | 0 | this.value = value; |
72 | 0 | } |
73 | |
|
74 | |
|
75 | |
public void beforeInsert(){ |
76 | 0 | OrmUtils.populateAutoIncValue(this, KEWServiceLocator.getEntityManagerFactory().createEntityManager()); |
77 | 0 | } |
78 | |
|
79 | |
public RuleExtensionBo getExtension() { |
80 | 0 | return extension; |
81 | |
} |
82 | |
public void setExtension(RuleExtensionBo extension) { |
83 | 0 | this.extension = extension; |
84 | 0 | } |
85 | |
public Integer getLockVerNbr() { |
86 | 0 | return lockVerNbr; |
87 | |
} |
88 | |
public void setLockVerNbr(Integer lockVerNbr) { |
89 | 0 | this.lockVerNbr = lockVerNbr; |
90 | 0 | } |
91 | |
public String getKey() { |
92 | 0 | return key; |
93 | |
} |
94 | |
public void setKey(String key) { |
95 | 0 | this.key = key; |
96 | 0 | } |
97 | |
public String getRuleExtensionId() { |
98 | 0 | return ruleExtensionId; |
99 | |
} |
100 | |
public void setRuleExtensionId(String ruleExtensionId) { |
101 | 0 | this.ruleExtensionId = ruleExtensionId; |
102 | 0 | } |
103 | |
public String getRuleExtensionValueId() { |
104 | 0 | return ruleExtensionValueId; |
105 | |
} |
106 | |
public void setRuleExtensionValueId(String ruleExtensionValueId) { |
107 | 0 | this.ruleExtensionValueId = ruleExtensionValueId; |
108 | 0 | } |
109 | |
public String getValue() { |
110 | 0 | return value; |
111 | |
} |
112 | |
public void setValue(String value) { |
113 | 0 | this.value = value; |
114 | 0 | } |
115 | |
|
116 | |
public boolean equals(Object o) { |
117 | 0 | if (o == null) return false; |
118 | 0 | if (!(o instanceof RuleExtensionValue)) return false; |
119 | 0 | RuleExtensionValue pred = (RuleExtensionValue) o; |
120 | 0 | return ObjectUtils.equals(key, pred.key) && ObjectUtils.equals(value, pred.value); |
121 | |
} |
122 | |
|
123 | |
public String toString() { |
124 | 0 | return "[RuleExtensionValue:" |
125 | |
+ " ruleExtensionValueId=" + ruleExtensionValueId |
126 | |
+ ", ruleExtensionId=" + ruleExtensionId |
127 | |
+ ", value=" + value |
128 | |
+ ", key=" + key |
129 | |
+ ", lockVerNbr=" + lockVerNbr |
130 | |
+ "]"; |
131 | |
|
132 | |
} |
133 | |
} |