1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.rice.kew.rule; |
18 | |
|
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.rule.bo.RuleTemplate; |
23 | |
import org.kuali.rice.kew.service.KEWServiceLocator; |
24 | |
|
25 | |
import javax.persistence.*; |
26 | |
import java.io.Serializable; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
@Entity |
39 | |
@Table(name="KREW_RULE_TMPL_OPTN_T") |
40 | |
|
41 | |
public class RuleTemplateOption implements Serializable { |
42 | |
|
43 | |
private static final long serialVersionUID = 8913119135197149224L; |
44 | |
@Id |
45 | |
@GeneratedValue(generator="KREW_RULE_TMPL_OPTN_S") |
46 | |
@GenericGenerator(name="KREW_RULE_TMPL_OPTN_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters={ |
47 | |
@Parameter(name="sequence_name",value="KREW_RULE_TMPL_OPTN_S"), |
48 | |
@Parameter(name="value_column",value="id") |
49 | |
}) |
50 | |
@Column(name="RULE_TMPL_OPTN_ID") |
51 | |
private Long ruleTemplateOptionId; |
52 | |
@Column(name="RULE_TMPL_ID", insertable=false, updatable=false) |
53 | |
private Long ruleTemplateId; |
54 | |
@Column(name="KEY_CD") |
55 | |
private String key; |
56 | |
@Column(name="VAL") |
57 | |
private String value; |
58 | |
@Version |
59 | |
@Column(name="VER_NBR") |
60 | |
private Integer lockVerNbr; |
61 | |
|
62 | |
@ManyToOne(fetch=FetchType.EAGER) |
63 | |
@JoinColumn(name="RULE_TMPL_ID") |
64 | |
private RuleTemplate ruleTemplate; |
65 | |
|
66 | 0 | public RuleTemplateOption(){} |
67 | |
|
68 | 0 | public RuleTemplateOption(String key, String value){ |
69 | 0 | this.key = key; |
70 | 0 | this.value = value; |
71 | 0 | } |
72 | |
|
73 | |
|
74 | |
public void beforeInsert(){ |
75 | 0 | OrmUtils.populateAutoIncValue(this, KEWServiceLocator.getEntityManagerFactory().createEntityManager()); |
76 | 0 | } |
77 | |
|
78 | |
public String getKey() { |
79 | 0 | return key; |
80 | |
} |
81 | |
|
82 | |
public void setKey(String key) { |
83 | 0 | this.key = key; |
84 | 0 | } |
85 | |
|
86 | |
public Integer getLockVerNbr() { |
87 | 0 | return lockVerNbr; |
88 | |
} |
89 | |
|
90 | |
public void setLockVerNbr(Integer lockVerNbr) { |
91 | 0 | this.lockVerNbr = lockVerNbr; |
92 | 0 | } |
93 | |
|
94 | |
public RuleTemplate getRuleTemplate() { |
95 | 0 | return ruleTemplate; |
96 | |
} |
97 | |
|
98 | |
public void setRuleTemplate(RuleTemplate ruleTemplate) { |
99 | 0 | this.ruleTemplate = ruleTemplate; |
100 | 0 | } |
101 | |
|
102 | |
public Long getRuleTemplateId() { |
103 | 0 | return ruleTemplateId; |
104 | |
} |
105 | |
|
106 | |
public void setRuleTemplateId(Long ruleTemplateId) { |
107 | 0 | this.ruleTemplateId = ruleTemplateId; |
108 | 0 | } |
109 | |
|
110 | |
public Long getRuleTemplateOptionId() { |
111 | 0 | return ruleTemplateOptionId; |
112 | |
} |
113 | |
|
114 | |
public void setRuleTemplateOptionId(Long ruleTemplateOptionId) { |
115 | 0 | this.ruleTemplateOptionId = ruleTemplateOptionId; |
116 | 0 | } |
117 | |
|
118 | |
public String getValue() { |
119 | 0 | return value; |
120 | |
} |
121 | |
|
122 | |
public void setValue(String value) { |
123 | 0 | this.value = value; |
124 | 0 | } |
125 | |
} |
126 | |
|