1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.rice.kew.rule.bo; |
18 | |
|
19 | |
import java.util.ArrayList; |
20 | |
import java.util.List; |
21 | |
|
22 | |
import javax.persistence.Basic; |
23 | |
import javax.persistence.CascadeType; |
24 | |
import javax.persistence.Column; |
25 | |
import javax.persistence.Entity; |
26 | |
import javax.persistence.FetchType; |
27 | |
import javax.persistence.GeneratedValue; |
28 | |
import javax.persistence.Id; |
29 | |
import javax.persistence.Lob; |
30 | |
import javax.persistence.NamedQueries; |
31 | |
import javax.persistence.NamedQuery; |
32 | |
import javax.persistence.OneToMany; |
33 | |
import javax.persistence.Table; |
34 | |
import javax.persistence.Transient; |
35 | |
|
36 | |
import org.hibernate.annotations.Fetch; |
37 | |
import org.hibernate.annotations.FetchMode; |
38 | |
import org.hibernate.annotations.GenericGenerator; |
39 | |
import org.hibernate.annotations.Parameter; |
40 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase; |
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
@Entity |
50 | |
@Table(name="KREW_RULE_ATTR_T") |
51 | |
|
52 | |
@NamedQueries({ |
53 | |
@NamedQuery(name="RuleAttribute.FindById", query="select ra from RuleAttribute ra where ra.ruleAttributeId = :ruleAttributeId"), |
54 | |
@NamedQuery(name="RuleAttribute.FindByName", query="select ra from RuleAttribute ra where ra.name = :name"), |
55 | |
@NamedQuery(name="RuleAttribute.FindByClassName", query="select ra from RuleAttribute ra where ra.className = :className"), |
56 | |
@NamedQuery(name="RuleAttribute.GetAllRuleAttributes", query="select ra from RuleAttribute ra") |
57 | |
}) |
58 | |
public class RuleAttribute extends PersistableBusinessObjectBase { |
59 | |
|
60 | |
private static final long serialVersionUID = 1027673603158346349L; |
61 | |
@Id |
62 | |
@GeneratedValue(generator="KREW_RTE_TMPL_S") |
63 | |
@GenericGenerator(name="KREW_RTE_TMPL_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters={ |
64 | |
@Parameter(name="sequence_name",value="KREW_RTE_TMPL_S"), |
65 | |
@Parameter(name="value_column",value="id") |
66 | |
}) |
67 | |
@Column(name="RULE_ATTR_ID") |
68 | |
private String ruleAttributeId; |
69 | |
@Column(name="NM") |
70 | |
private String name; |
71 | |
@Column(name="LBL") |
72 | |
private String label; |
73 | |
@Column(name="RULE_ATTR_TYP_CD") |
74 | |
private String type; |
75 | |
@Column(name="CLS_NM") |
76 | |
private String className; |
77 | |
@Column(name="DESC_TXT") |
78 | |
private String description; |
79 | |
@Lob |
80 | |
@Basic(fetch=FetchType.LAZY) |
81 | |
@Column(name="XML") |
82 | |
private String xmlConfigData; |
83 | |
|
84 | |
@Column(name="APPL_ID") |
85 | |
private String applicationId; |
86 | |
|
87 | |
@OneToMany(fetch=FetchType.EAGER,cascade={CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.MERGE}, |
88 | |
targetEntity=org.kuali.rice.kew.rule.bo.RuleTemplateAttribute.class, mappedBy="ruleAttribute") |
89 | |
@Fetch(value=FetchMode.SELECT) |
90 | |
private List ruleTemplateAttributes; |
91 | |
@Transient |
92 | |
private List validValues; |
93 | |
|
94 | |
|
95 | |
@Transient |
96 | |
private String returnUrl; |
97 | |
|
98 | 0 | public RuleAttribute() { |
99 | 0 | ruleTemplateAttributes = new ArrayList(); |
100 | 0 | validValues = new ArrayList(); |
101 | 0 | } |
102 | |
|
103 | |
public List getValidValues() { |
104 | 0 | return validValues; |
105 | |
} |
106 | |
public void setValidValues(List ruleAttributeValidValues) { |
107 | 0 | this.validValues = ruleAttributeValidValues; |
108 | 0 | } |
109 | |
public List getRuleTemplateAttributes() { |
110 | 0 | return ruleTemplateAttributes; |
111 | |
} |
112 | |
public void setRuleTemplateAttributes(List ruleTemplateAttributes) { |
113 | 0 | this.ruleTemplateAttributes = ruleTemplateAttributes; |
114 | 0 | } |
115 | |
public String getDescription() { |
116 | 0 | return description; |
117 | |
} |
118 | |
public void setDescription(String description) { |
119 | 0 | this.description = description; |
120 | 0 | } |
121 | |
public String getLabel() { |
122 | 0 | return label; |
123 | |
} |
124 | |
public void setLabel(String label) { |
125 | 0 | this.label = label; |
126 | 0 | } |
127 | |
|
128 | |
public String getName() { |
129 | 0 | return name; |
130 | |
} |
131 | |
public void setName(String name) { |
132 | 0 | this.name = name; |
133 | 0 | } |
134 | |
public String getRuleAttributeId() { |
135 | 0 | return ruleAttributeId; |
136 | |
} |
137 | |
public void setRuleAttributeId(String ruleAttributeId) { |
138 | 0 | this.ruleAttributeId = ruleAttributeId; |
139 | 0 | } |
140 | |
public String getType() { |
141 | 0 | return type; |
142 | |
} |
143 | |
public void setType(String type) { |
144 | 0 | this.type = type; |
145 | 0 | } |
146 | |
|
147 | |
|
148 | |
|
149 | |
|
150 | |
public String getClassName() { |
151 | 0 | return className; |
152 | |
} |
153 | |
|
154 | |
|
155 | |
|
156 | |
public void setClassName(String className) { |
157 | 0 | this.className = className; |
158 | 0 | } |
159 | |
|
160 | |
public String getRuleAttributeActionsUrl() { |
161 | 0 | return "<a href=\"RuleAttributeReport.do?ruleAttributeId="+ruleAttributeId+"\" >report</a>"; |
162 | |
} |
163 | |
|
164 | |
public String getReturnUrl() { |
165 | 0 | return returnUrl; |
166 | |
} |
167 | |
public void setReturnUrl(String returnUrl) { |
168 | 0 | this.returnUrl = returnUrl; |
169 | 0 | } |
170 | |
|
171 | |
public String getXmlConfigData() { |
172 | 0 | return xmlConfigData; |
173 | |
} |
174 | |
|
175 | |
public void setXmlConfigData(String xmlConfigData) { |
176 | 0 | this.xmlConfigData = xmlConfigData; |
177 | 0 | } |
178 | |
|
179 | |
public String getApplicationId() { |
180 | 0 | return applicationId; |
181 | |
} |
182 | |
|
183 | |
public void setApplicationId(String applicationId) { |
184 | 0 | this.applicationId = applicationId; |
185 | 0 | } |
186 | |
} |