1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.engine.node;
17
18 import org.hibernate.annotations.GenericGenerator;
19 import org.hibernate.annotations.Parameter;
20 import org.kuali.rice.core.api.util.KeyValue;
21 import org.kuali.rice.kew.api.doctype.RouteNodeConfigurationParameterContract;
22 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
23
24 import javax.persistence.AttributeOverride;
25 import javax.persistence.AttributeOverrides;
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.FetchType;
29 import javax.persistence.GeneratedValue;
30 import javax.persistence.Id;
31 import javax.persistence.JoinColumn;
32 import javax.persistence.ManyToOne;
33 import javax.persistence.Table;
34
35
36
37
38
39
40
41
42
43 @Entity
44 @Table(name="KREW_RTE_NODE_CFG_PARM_T")
45 @AttributeOverrides({@AttributeOverride(name="key", column=@Column(name="KEY_CD")), @AttributeOverride(name="value", column=@Column(name="VAL"))})
46 public class RouteNodeConfigParam extends PersistableBusinessObjectBase implements KeyValue, RouteNodeConfigurationParameterContract {
47 private static final long serialVersionUID = 5592421070149273014L;
48
49
50
51
52 @Id
53 @Column(name="RTE_NODE_CFG_PARM_ID")
54 @GeneratedValue(generator="KREW_RTE_NODE_CFG_PARM_S")
55 @GenericGenerator(name="KREW_RTE_NODE_CFG_PARM_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters={
56 @Parameter(name="sequence_name",value="KREW_RTE_NODE_CFG_PARM_S"),
57 @Parameter(name="value_column",value="id")
58 })
59
60 private String id;
61 private String key;
62 private String value;
63
64
65
66 @ManyToOne(fetch=FetchType.EAGER)
67 @JoinColumn(name="RTE_NODE_ID")
68 private RouteNode routeNode;
69
70 public RouteNodeConfigParam() {}
71
72 public RouteNodeConfigParam(RouteNode routeNode, String key, String value) {
73 this.key = key;
74 this.value = value;
75 this.routeNode = routeNode;
76 }
77
78
79
80
81 @Override
82 public String getId() {
83 return this.id;
84 }
85
86
87
88 public void setId(String id) {
89 this.id = id;
90 }
91
92
93
94 public RouteNode getRouteNode() {
95 return this.routeNode;
96 }
97
98
99
100 public void setRouteNode(RouteNode routeNode) {
101 this.routeNode = routeNode;
102 }
103
104 @Override
105 public String getKey() {
106 return key;
107 }
108
109 @Override
110 public String getValue() {
111 return value;
112 }
113
114 public void setKey(String key) {
115 this.key = key;
116 }
117
118 public void setValue(String value) {
119 this.value = value;
120 }
121
122 @Override
123 public String getRouteNodeId() {
124 if (routeNode == null || routeNode.getRouteNodeId() == null) {
125 return null;
126 }
127 return routeNode.getRouteNodeId().toString();
128 }
129
130
131 }