1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.lum.lrc.entity; |
17 | |
|
18 | |
import java.util.Date; |
19 | |
import java.util.List; |
20 | |
|
21 | |
import javax.persistence.CascadeType; |
22 | |
import javax.persistence.Column; |
23 | |
import javax.persistence.Entity; |
24 | |
import javax.persistence.JoinColumn; |
25 | |
import javax.persistence.ManyToOne; |
26 | |
import javax.persistence.NamedQueries; |
27 | |
import javax.persistence.NamedQuery; |
28 | |
import javax.persistence.OneToMany; |
29 | |
import javax.persistence.Table; |
30 | |
import javax.persistence.Temporal; |
31 | |
import javax.persistence.TemporalType; |
32 | |
|
33 | |
import org.kuali.student.common.entity.AttributeOwner; |
34 | |
import org.kuali.student.common.entity.MetaEntity; |
35 | |
|
36 | |
@Entity |
37 | |
@Table(name = "KSLR_RESCOMP") |
38 | |
@NamedQueries( { |
39 | |
@NamedQuery(name = "ResultComponent.getResultComponentIdsByResult", query = "SELECT rc.id FROM ResultComponent rc JOIN rc.resultValues rv WHERE rv.id = :resultValueId AND rc.type.id = :resultComponentTypeKey"), |
40 | |
@NamedQuery(name = "ResultComponent.getResultComponentIdsByResultComponentType", query = "SELECT rc.id FROM ResultComponent rc WHERE rc.type.id = :resultComponentTypeKey"), |
41 | |
@NamedQuery(name = "ResultComponent.getResultComponentType", query = "SELECT rc.type FROM ResultComponent rc WHERE rc.type.id = :resultComponentTypeKey") |
42 | |
}) |
43 | |
|
44 | 100 | public class ResultComponent extends MetaEntity implements AttributeOwner<ResultComponentAttribute> { |
45 | |
private static final long serialVersionUID = 1L; |
46 | |
|
47 | |
@Column(name = "NAME") |
48 | |
private String name; |
49 | |
|
50 | |
@ManyToOne(cascade = CascadeType.ALL) |
51 | |
@JoinColumn(name = "RT_DESCR_ID") |
52 | |
private LrcRichText descr; |
53 | |
|
54 | |
@OneToMany(cascade = CascadeType.ALL, mappedBy = "resultComponent") |
55 | |
private List<ResultValue> resultValues; |
56 | |
|
57 | |
@Temporal(TemporalType.TIMESTAMP) |
58 | |
@Column(name = "EFF_DT") |
59 | |
private Date effectiveDate; |
60 | |
|
61 | |
@Temporal(TemporalType.TIMESTAMP) |
62 | |
@Column(name = "EXPIR_DT") |
63 | |
private Date expirationDate; |
64 | |
|
65 | |
@OneToMany(cascade = CascadeType.ALL, mappedBy = "owner") |
66 | |
private List<ResultComponentAttribute> attributes; |
67 | |
|
68 | |
@ManyToOne |
69 | |
@JoinColumn(name = "TYPE") |
70 | |
private ResultComponentType type; |
71 | |
|
72 | |
@Column(name = "STATE") |
73 | |
private String state; |
74 | |
|
75 | |
|
76 | |
|
77 | |
|
78 | |
public String getName() { |
79 | 111 | return name; |
80 | |
} |
81 | |
|
82 | |
|
83 | |
|
84 | |
|
85 | |
public void setName(String name) { |
86 | 7 | this.name = name; |
87 | 7 | } |
88 | |
|
89 | |
|
90 | |
|
91 | |
|
92 | |
public LrcRichText getDescr() { |
93 | 111 | return descr; |
94 | |
} |
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
public void setDescr(LrcRichText descr) { |
100 | 7 | this.descr = descr; |
101 | 7 | } |
102 | |
|
103 | |
|
104 | |
|
105 | |
|
106 | |
public List<ResultValue> getResultValues() { |
107 | 231 | return resultValues; |
108 | |
} |
109 | |
|
110 | |
|
111 | |
|
112 | |
|
113 | |
public void setResultValues(List<ResultValue> resultValues) { |
114 | 7 | this.resultValues = resultValues; |
115 | 7 | } |
116 | |
|
117 | |
|
118 | |
|
119 | |
|
120 | |
public Date getEffectiveDate() { |
121 | 111 | return effectiveDate; |
122 | |
} |
123 | |
|
124 | |
|
125 | |
|
126 | |
|
127 | |
public void setEffectiveDate(Date effectiveDate) { |
128 | 7 | this.effectiveDate = effectiveDate; |
129 | 7 | } |
130 | |
|
131 | |
|
132 | |
|
133 | |
|
134 | |
public Date getExpirationDate() { |
135 | 111 | return expirationDate; |
136 | |
} |
137 | |
|
138 | |
|
139 | |
|
140 | |
|
141 | |
public void setExpirationDate(Date expirationDate) { |
142 | 7 | this.expirationDate = expirationDate; |
143 | 7 | } |
144 | |
|
145 | |
|
146 | |
|
147 | |
|
148 | |
public ResultComponentType getType() { |
149 | 111 | return type; |
150 | |
} |
151 | |
|
152 | |
|
153 | |
|
154 | |
|
155 | |
public void setType(ResultComponentType type) { |
156 | 7 | this.type = type; |
157 | 7 | } |
158 | |
|
159 | |
|
160 | |
|
161 | |
|
162 | |
public String getState() { |
163 | 111 | return state; |
164 | |
} |
165 | |
|
166 | |
|
167 | |
|
168 | |
|
169 | |
public void setState(String state) { |
170 | 7 | this.state = state; |
171 | 7 | } |
172 | |
|
173 | |
@Override |
174 | |
public List<ResultComponentAttribute> getAttributes() { |
175 | 132 | return attributes; |
176 | |
} |
177 | |
|
178 | |
@Override |
179 | |
public void setAttributes(List<ResultComponentAttribute> attributes) { |
180 | 12 | this.attributes = attributes; |
181 | 12 | } |
182 | |
|
183 | |
} |