1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krms.impl.repository;
17
18 import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
19 import org.kuali.rice.krms.api.repository.language.NaturalLanguageTemplateAttribute;
20 import org.kuali.rice.krms.api.repository.language.NaturalLanguageTemplateAttributeContract;
21 import org.kuali.rice.krms.api.repository.type.KrmsAttributeDefinitionContract;
22
23 import javax.persistence.CascadeType;
24 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.GeneratedValue;
27 import javax.persistence.Id;
28 import javax.persistence.JoinColumn;
29 import javax.persistence.ManyToOne;
30 import javax.persistence.Table;
31 import javax.persistence.Version;
32 import java.io.Serializable;
33
34
35
36
37
38
39 @Entity
40 @Table(name = "KRMS_NL_TMPL_ATTR_T")
41 public class NaturalLanguageTemplateAttributeBo implements NaturalLanguageTemplateAttributeContract, Serializable {
42
43 private static final long serialVersionUID = 1l;
44
45 @Column(name = "NL_TMPL_ID")
46 private String naturalLanguageTemplateId;
47
48 @Column(name = "VER_NBR")
49 @Version
50 private Long versionNumber;
51
52 @Column(name = "ATTR_VAL")
53 private String value;
54
55 @Column(name = "ATTR_DEFN_ID")
56 private String attributeDefinitionId;
57
58 @ManyToOne(targetEntity = KrmsAttributeDefinitionBo.class, cascade = { CascadeType.REFRESH })
59 @JoinColumn(name = "ATTR_DEFN_ID", referencedColumnName = "ATTR_DEFN_ID", insertable = false, updatable = false)
60 private KrmsAttributeDefinitionContract attributeDefinition;
61
62 @PortableSequenceGenerator(name = "KRMS_NL_TMPL_ATTR_S")
63 @GeneratedValue(generator = "KRMS_NL_TMPL_ATTR_S")
64 @Id
65 @Column(name = "NL_TMPL_ATTR_ID")
66 private String id;
67
68
69
70
71
72 public NaturalLanguageTemplateAttributeBo() {
73 }
74
75 @Override
76 public String getNaturalLanguageTemplateId() {
77 return this.naturalLanguageTemplateId;
78 }
79
80 @Override
81 public Long getVersionNumber() {
82 return this.versionNumber;
83 }
84
85 @Override
86 public String getValue() {
87 return this.value;
88 }
89
90 @Override
91 public String getAttributeDefinitionId() {
92 return this.attributeDefinitionId;
93 }
94
95 @Override
96 public KrmsAttributeDefinitionContract getAttributeDefinition() {
97 return this.attributeDefinition;
98 }
99
100 @Override
101 public String getId() {
102 return this.id;
103 }
104
105
106
107
108
109
110
111 public void setNaturalLanguageTemplateId(String naturalLanguageTemplateId) {
112 this.naturalLanguageTemplateId = naturalLanguageTemplateId;
113 }
114
115
116
117
118
119
120
121 public void setVersionNumber(Long versionNumber) {
122 this.versionNumber = versionNumber;
123 }
124
125
126
127
128
129
130
131 public void setValue(String value) {
132 this.value = value;
133 }
134
135
136
137
138
139
140
141 public void setAttributeDefinitionId(String attributeDefinitionId) {
142 this.attributeDefinitionId = attributeDefinitionId;
143 }
144
145
146
147
148
149
150
151 public void setAttributeDefinition(KrmsAttributeDefinitionContract attributeDefinition) {
152 this.attributeDefinition = attributeDefinition;
153 }
154
155
156
157
158
159
160
161 public void setId(String id) {
162 this.id = id;
163 }
164
165
166
167
168
169
170
171 public static NaturalLanguageTemplateAttribute to(NaturalLanguageTemplateAttributeBo naturalLanguageTemplateAttributeBo) {
172 if (naturalLanguageTemplateAttributeBo == null) {
173 return null;
174 }
175
176 return NaturalLanguageTemplateAttribute.Builder.create(naturalLanguageTemplateAttributeBo).build();
177 }
178
179
180
181
182
183
184
185 public static org.kuali.rice.krms.impl.repository.NaturalLanguageTemplateAttributeBo from(NaturalLanguageTemplateAttribute naturalLanguageTemplateAttribute) {
186 if (naturalLanguageTemplateAttribute == null) {
187 return null;
188 }
189
190 NaturalLanguageTemplateAttributeBo naturalLanguageTemplateAttributeBo = new NaturalLanguageTemplateAttributeBo();
191 naturalLanguageTemplateAttributeBo.setNaturalLanguageTemplateId(naturalLanguageTemplateAttribute.getNaturalLanguageTemplateId());
192 naturalLanguageTemplateAttributeBo.setVersionNumber(naturalLanguageTemplateAttribute.getVersionNumber());
193 naturalLanguageTemplateAttributeBo.setValue(naturalLanguageTemplateAttribute.getValue());
194 naturalLanguageTemplateAttributeBo.setAttributeDefinitionId(naturalLanguageTemplateAttribute.getAttributeDefinitionId());
195 naturalLanguageTemplateAttributeBo.setAttributeDefinition(naturalLanguageTemplateAttribute.getAttributeDefinition());
196 naturalLanguageTemplateAttributeBo.setId(naturalLanguageTemplateAttribute.getId());
197
198
199 return naturalLanguageTemplateAttributeBo;
200 }
201 }