1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.lum.lu.entity; |
17 | |
|
18 | |
import java.util.Date; |
19 | |
import java.util.List; |
20 | |
|
21 | |
import javax.persistence.AttributeOverride; |
22 | |
import javax.persistence.AttributeOverrides; |
23 | |
import javax.persistence.CascadeType; |
24 | |
import javax.persistence.Column; |
25 | |
import javax.persistence.Embedded; |
26 | |
import javax.persistence.Entity; |
27 | |
import javax.persistence.JoinColumn; |
28 | |
import javax.persistence.JoinTable; |
29 | |
import javax.persistence.ManyToOne; |
30 | |
import javax.persistence.NamedQueries; |
31 | |
import javax.persistence.NamedQuery; |
32 | |
import javax.persistence.OneToMany; |
33 | |
import javax.persistence.OneToOne; |
34 | |
import javax.persistence.Table; |
35 | |
import javax.persistence.Temporal; |
36 | |
import javax.persistence.TemporalType; |
37 | |
import javax.persistence.UniqueConstraint; |
38 | |
|
39 | |
import org.kuali.student.common.entity.Amount; |
40 | |
import org.kuali.student.common.entity.AttributeOwner; |
41 | |
import org.kuali.student.common.entity.TimeAmount; |
42 | |
import org.kuali.student.common.entity.VersionEntity; |
43 | |
|
44 | |
@Entity |
45 | |
@Table(name = "KSLU_CLU", uniqueConstraints={@UniqueConstraint(columnNames={"VER_IND_ID", "SEQ_NUM"})} ) |
46 | |
@NamedQueries( { |
47 | |
|
48 | |
|
49 | |
@NamedQuery(name = "Clu.findCurrentVersionInfo", query = "SELECT " + |
50 | |
"NEW org.kuali.student.common.versionmanagement.dto.VersionDisplayInfo(c.id, c.version.versionIndId, c.version.sequenceNumber, c.version.currentVersionStart, c.version.currentVersionEnd, c.version.versionComment, c.version.versionedFromId) " + |
51 | |
"FROM Clu c " + |
52 | |
"WHERE c.version.versionIndId = :versionIndId " + |
53 | |
"AND c.version.currentVersionStart <= :currentTime AND (c.version.currentVersionEnd > :currentTime OR c.version.currentVersionEnd IS NULL)"), |
54 | |
@NamedQuery(name = "Clu.findCurrentVersionOnDate", query = "SELECT " + |
55 | |
"NEW org.kuali.student.common.versionmanagement.dto.VersionDisplayInfo(c.id, c.version.versionIndId, c.version.sequenceNumber, c.version.currentVersionStart, c.version.currentVersionEnd, c.version.versionComment, c.version.versionedFromId) " + |
56 | |
"FROM Clu c " + |
57 | |
"WHERE c.version.versionIndId = :versionIndId " + |
58 | |
"AND c.version.currentVersionStart <= :date AND (c.version.currentVersionEnd > :date OR c.version.currentVersionEnd IS NULL)"), |
59 | |
@NamedQuery(name = "Clu.findFirstVersion", query = "SELECT " + |
60 | |
"NEW org.kuali.student.common.versionmanagement.dto.VersionDisplayInfo(c.id, c.version.versionIndId, c.version.sequenceNumber, c.version.currentVersionStart, c.version.currentVersionEnd, c.version.versionComment, c.version.versionedFromId) " + |
61 | |
"FROM Clu c " + |
62 | |
"WHERE c.version.versionIndId = :versionIndId " + |
63 | |
"AND c.version.sequenceNumber IN (SELECT MIN(nc.version.sequenceNumber) FROM Clu nc WHERE nc.version.versionIndId = :versionIndId)"), |
64 | |
@NamedQuery(name = "Clu.findLatestVersion", query = "SELECT " + |
65 | |
"NEW org.kuali.student.common.versionmanagement.dto.VersionDisplayInfo(c.id, c.version.versionIndId, c.version.sequenceNumber, c.version.currentVersionStart, c.version.currentVersionEnd, c.version.versionComment, c.version.versionedFromId) " + |
66 | |
"FROM Clu c " + |
67 | |
"WHERE c.version.versionIndId = :versionIndId " + |
68 | |
"AND c.version.sequenceNumber IN (SELECT MAX(nc.version.sequenceNumber) FROM Clu nc WHERE nc.version.versionIndId = :versionIndId)"), |
69 | |
@NamedQuery(name = "Clu.findVersionBySequence", query = "SELECT " + |
70 | |
"NEW org.kuali.student.common.versionmanagement.dto.VersionDisplayInfo(c.id, c.version.versionIndId, c.version.sequenceNumber, c.version.currentVersionStart, c.version.currentVersionEnd, c.version.versionComment, c.version.versionedFromId) " + |
71 | |
"FROM Clu c " + |
72 | |
"WHERE c.version.versionIndId = :versionIndId " + |
73 | |
"AND c.version.sequenceNumber = :sequenceNumber"), |
74 | |
@NamedQuery(name = "Clu.findVersions", query = "SELECT " + |
75 | |
"NEW org.kuali.student.common.versionmanagement.dto.VersionDisplayInfo(c.id, c.version.versionIndId, c.version.sequenceNumber, c.version.currentVersionStart, c.version.currentVersionEnd, c.version.versionComment, c.version.versionedFromId) " + |
76 | |
"FROM Clu c " + |
77 | |
"WHERE c.version.versionIndId = :versionIndId"), |
78 | |
@NamedQuery(name = "Clu.findVersionsInDateRange", query = "SELECT " + |
79 | |
"NEW org.kuali.student.common.versionmanagement.dto.VersionDisplayInfo(c.id, c.version.versionIndId, c.version.sequenceNumber, c.version.currentVersionStart, c.version.currentVersionEnd, c.version.versionComment, c.version.versionedFromId) " + |
80 | |
"FROM Clu c " + |
81 | |
"WHERE c.version.versionIndId = :versionIndId " + |
82 | |
"AND ( (c.version.currentVersionStart >= :from AND c.version.currentVersionStart < :to)" + |
83 | |
" OR (c.version.currentVersionStart < :from AND c.version.currentVersionEnd > :from) )"), |
84 | |
@NamedQuery(name = "Clu.findVersionsBeforeDate", query = "SELECT " + |
85 | |
"NEW org.kuali.student.common.versionmanagement.dto.VersionDisplayInfo(c.id, c.version.versionIndId, c.version.sequenceNumber, c.version.currentVersionStart, c.version.currentVersionEnd, c.version.versionComment, c.version.versionedFromId) " + |
86 | |
"FROM Clu c " + |
87 | |
"WHERE c.version.versionIndId = :versionIndId " + |
88 | |
"AND c.version.currentVersionStart <= :date"), |
89 | |
@NamedQuery(name = "Clu.findVersionsAfterDate", query = "SELECT " + |
90 | |
"NEW org.kuali.student.common.versionmanagement.dto.VersionDisplayInfo(c.id, c.version.versionIndId, c.version.sequenceNumber, c.version.currentVersionStart, c.version.currentVersionEnd, c.version.versionComment, c.version.versionedFromId) " + |
91 | |
"FROM Clu c " + |
92 | |
"WHERE c.version.versionIndId = :versionIndId " + |
93 | |
"AND c.version.currentVersionStart >= :date"), |
94 | |
@NamedQuery(name = "Clu.findLatestClu", query = "SELECT c FROM Clu c WHERE c.version.versionIndId = :versionIndId AND c.version.sequenceNumber IN (SELECT MAX(nc.version.sequenceNumber) FROM Clu nc WHERE nc.version.versionIndId = :versionIndId)"), |
95 | |
@NamedQuery(name = "Clu.findCurrentClu", query = "SELECT c FROM Clu c WHERE c.version.versionIndId = :versionIndId AND c.version.currentVersionStart <= :currentTime AND (c.version.currentVersionEnd > :currentTime OR c.version.currentVersionEnd IS NULL)"), |
96 | |
@NamedQuery(name = "Clu.findClusByIdList", query = "SELECT c FROM Clu c WHERE c.id IN (:idList)"), |
97 | |
@NamedQuery(name = "Clu.getClusByLuType", query = "SELECT c FROM Clu c WHERE c.state = :luState AND c.luType.id = :luTypeKey"), |
98 | |
@NamedQuery(name = "Clu.getClusByRelation", query = "SELECT c FROM Clu c WHERE c.id IN (SELECT ccr.relatedClu.id FROM CluCluRelation ccr WHERE ccr.clu.id = :parentCluId AND ccr.luLuRelationType.id = :luLuRelationTypeKey)"), |
99 | |
@NamedQuery(name = "Clu.getCrossListedClusByCodes", query = "SELECT c FROM Clu c WHERE c.state='Active' AND c.officialIdentifier.code IN (:crossListedCodes) ") |
100 | |
|
101 | |
}) |
102 | 765 | public class Clu extends VersionEntity implements AttributeOwner<CluAttribute> { |
103 | |
|
104 | |
@OneToOne(cascade=CascadeType.ALL) |
105 | |
@JoinColumn(name = "OFFIC_CLU_ID") |
106 | |
private CluIdentifier officialIdentifier; |
107 | |
|
108 | |
@OneToMany(cascade=CascadeType.ALL) |
109 | |
@JoinTable(name = "KSLU_CLU_JN_CLU_IDENT", joinColumns = @JoinColumn(name = "CLU_ID"), inverseJoinColumns = @JoinColumn(name = "ALT_CLU_ID")) |
110 | |
private List<CluIdentifier> alternateIdentifiers; |
111 | |
|
112 | |
@Column(name = "STDY_SUBJ_AREA") |
113 | |
private String studySubjectArea; |
114 | |
|
115 | |
@ManyToOne(cascade=CascadeType.ALL) |
116 | |
@JoinColumn(name = "RT_DESCR_ID") |
117 | |
private LuRichText descr; |
118 | |
|
119 | |
@OneToMany(cascade=CascadeType.ALL, mappedBy = "clu") |
120 | |
private List<CluCampusLocation> campusLocations; |
121 | |
|
122 | |
@OneToMany(cascade=CascadeType.ALL) |
123 | |
@JoinTable(name = "KSLU_CLU_JN_ACCRED", joinColumns = @JoinColumn(name = "CLU_ID"), inverseJoinColumns = @JoinColumn(name = "CLU_ACCRED_ID")) |
124 | |
private List<CluAccreditation> accreditations; |
125 | |
|
126 | |
@OneToMany(cascade = CascadeType.ALL, mappedBy = "clu") |
127 | |
private List<CluAdminOrg> adminOrgs; |
128 | |
|
129 | |
@ManyToOne(cascade=CascadeType.ALL) |
130 | |
@JoinColumn(name="PRI_INSTR_ID") |
131 | |
private CluInstructor primaryInstructor; |
132 | |
|
133 | |
@OneToMany(cascade=CascadeType.ALL) |
134 | |
@JoinTable(name = "KSLU_CLU_JN_CLU_INSTR", joinColumns = @JoinColumn(name = "CLU_ID"), inverseJoinColumns = @JoinColumn(name = "CLU_INSTR_ID")) |
135 | |
private List<CluInstructor> instructors; |
136 | |
|
137 | |
@Column(name = "EXP_FIRST_ATP") |
138 | |
private String expectedFirstAtp; |
139 | |
|
140 | |
@Column(name = "LAST_ATP") |
141 | |
private String lastAtp; |
142 | |
|
143 | |
@Column(name = "LAST_ADMIT_ATP") |
144 | |
private String lastAdmitAtp; |
145 | |
|
146 | |
@Temporal(TemporalType.TIMESTAMP) |
147 | |
@Column(name = "EFF_DT") |
148 | |
private Date effectiveDate; |
149 | |
|
150 | |
@Temporal(TemporalType.TIMESTAMP) |
151 | |
@Column(name = "EXPIR_DT") |
152 | |
private Date expirationDate; |
153 | |
|
154 | |
@Embedded |
155 | |
@AttributeOverrides({ |
156 | |
@AttributeOverride(name="unitType", column=@Column(name="CLU_INTSTY_TYPE")), |
157 | |
@AttributeOverride(name="unitQuantity", column=@Column(name="CLU_INTSTY_QTY") |
158 | |
)}) |
159 | |
private Amount intensity; |
160 | |
|
161 | |
@Embedded |
162 | |
@Column(name = "STD_DUR") |
163 | |
private TimeAmount stdDuration; |
164 | |
|
165 | |
@Column(name = "CAN_CREATE_LUI") |
166 | |
private boolean canCreateLui; |
167 | |
|
168 | |
@Column(name = "REF_URL") |
169 | |
private String referenceURL; |
170 | |
|
171 | |
@OneToMany(cascade = CascadeType.ALL, mappedBy="clu") |
172 | |
private List<LuCode> luCodes; |
173 | |
|
174 | |
@Column(name = "NEXT_REVIEW_PRD") |
175 | |
private String nextReviewPeriod; |
176 | |
|
177 | |
@Column(name = "IS_ENRL") |
178 | |
private boolean enrollable; |
179 | |
|
180 | |
@OneToMany(cascade=CascadeType.ALL, mappedBy="clu") |
181 | |
private List<CluAtpTypeKey> offeredAtpTypes; |
182 | |
|
183 | |
@Column(name = "HAS_EARLY_DROP_DEDLN") |
184 | |
private boolean hasEarlyDropDeadline; |
185 | |
|
186 | |
@Column(name = "DEF_ENRL_EST") |
187 | |
private int defaultEnrollmentEstimate; |
188 | |
|
189 | |
@Column(name = "DEF_MAX_ENRL") |
190 | |
private int defaultMaximumEnrollment; |
191 | |
|
192 | |
@Column(name = "IS_HAZR_DISBLD_STU") |
193 | |
private boolean hazardousForDisabledStudents; |
194 | |
|
195 | |
@OneToOne(cascade=CascadeType.ALL) |
196 | |
@JoinColumn(name = "FEE_ID") |
197 | |
private CluFee fee; |
198 | |
|
199 | |
@OneToOne(cascade=CascadeType.ALL) |
200 | |
@JoinColumn(name = "ACCT_ID") |
201 | |
private CluAccounting accounting; |
202 | |
|
203 | |
@OneToMany(cascade = CascadeType.ALL, mappedBy = "owner") |
204 | |
private List<CluAttribute> attributes; |
205 | |
|
206 | |
@ManyToOne |
207 | |
@JoinColumn(name = "LUTYPE_ID") |
208 | |
private LuType luType; |
209 | |
|
210 | |
@Column(name = "ST") |
211 | |
private String state; |
212 | |
|
213 | |
public LuType getLuType() { |
214 | 747 | return luType; |
215 | |
} |
216 | |
|
217 | |
public void setLuType(LuType luType) { |
218 | 237 | this.luType = luType; |
219 | 237 | } |
220 | |
|
221 | |
@Override |
222 | |
public List<CluAttribute> getAttributes() { |
223 | 1264 | return attributes; |
224 | |
} |
225 | |
|
226 | |
@Override |
227 | |
public void setAttributes(List<CluAttribute> attributes) { |
228 | 426 | this.attributes = attributes; |
229 | 426 | } |
230 | |
|
231 | |
public CluIdentifier getOfficialIdentifier() { |
232 | 933 | return officialIdentifier; |
233 | |
} |
234 | |
|
235 | |
public void setOfficialIdentifier(CluIdentifier officialIdentifier) { |
236 | 57 | this.officialIdentifier = officialIdentifier; |
237 | 57 | } |
238 | |
|
239 | |
public List<CluIdentifier> getAlternateIdentifiers() { |
240 | 728 | return alternateIdentifiers; |
241 | |
} |
242 | |
|
243 | |
public void setAlternateIdentifiers(List<CluIdentifier> alternateIdentifiers) { |
244 | 189 | this.alternateIdentifiers = alternateIdentifiers; |
245 | 189 | } |
246 | |
|
247 | |
public String getStudySubjectArea() { |
248 | 553 | return studySubjectArea; |
249 | |
} |
250 | |
|
251 | |
public void setStudySubjectArea(String studySubjectArea) { |
252 | 237 | this.studySubjectArea = studySubjectArea; |
253 | 237 | } |
254 | |
|
255 | |
public LuRichText getDescr() { |
256 | 647 | return descr; |
257 | |
} |
258 | |
|
259 | |
public void setDescr(LuRichText descr) { |
260 | 57 | this.descr = descr; |
261 | 57 | } |
262 | |
|
263 | |
public List<CluInstructor> getInstructors() { |
264 | 1057 | return instructors; |
265 | |
} |
266 | |
|
267 | |
public void setInstructors(List<CluInstructor> instructors) { |
268 | 189 | this.instructors = instructors; |
269 | 189 | } |
270 | |
|
271 | |
public Date getEffectiveDate() { |
272 | 553 | return effectiveDate; |
273 | |
} |
274 | |
|
275 | |
public void setEffectiveDate(Date effectiveDate) { |
276 | 237 | this.effectiveDate = effectiveDate; |
277 | 237 | } |
278 | |
|
279 | |
public Date getExpirationDate() { |
280 | 553 | return expirationDate; |
281 | |
} |
282 | |
|
283 | |
public void setExpirationDate(Date expirationDate) { |
284 | 237 | this.expirationDate = expirationDate; |
285 | 237 | } |
286 | |
|
287 | |
public TimeAmount getStdDuration() { |
288 | 638 | return stdDuration; |
289 | |
} |
290 | |
|
291 | |
public void setStdDuration(TimeAmount stdDuration) { |
292 | 169 | this.stdDuration = stdDuration; |
293 | 169 | } |
294 | |
|
295 | |
public boolean isCanCreateLui() { |
296 | 553 | return canCreateLui; |
297 | |
} |
298 | |
|
299 | |
public void setCanCreateLui(boolean canCreateLui) { |
300 | 237 | this.canCreateLui = canCreateLui; |
301 | 237 | } |
302 | |
|
303 | |
public String getReferenceURL() { |
304 | 553 | return referenceURL; |
305 | |
} |
306 | |
|
307 | |
public void setReferenceURL(String referenceURL) { |
308 | 237 | this.referenceURL = referenceURL; |
309 | 237 | } |
310 | |
|
311 | |
public List<LuCode> getLuCodes() { |
312 | 1163 | return luCodes; |
313 | |
} |
314 | |
|
315 | |
public void setLuCodes(List<LuCode> luCodes) { |
316 | 189 | this.luCodes = luCodes; |
317 | 189 | } |
318 | |
|
319 | |
public String getNextReviewPeriod() { |
320 | 553 | return nextReviewPeriod; |
321 | |
} |
322 | |
|
323 | |
public void setNextReviewPeriod(String nextReviewPeriod) { |
324 | 237 | this.nextReviewPeriod = nextReviewPeriod; |
325 | 237 | } |
326 | |
|
327 | |
public boolean isEnrollable() { |
328 | 553 | return enrollable; |
329 | |
} |
330 | |
|
331 | |
public void setEnrollable(boolean enrollable) { |
332 | 237 | this.enrollable = enrollable; |
333 | 237 | } |
334 | |
|
335 | |
public List<CluAtpTypeKey> getOfferedAtpTypes() { |
336 | 2155 | return offeredAtpTypes; |
337 | |
} |
338 | |
|
339 | |
public void setOfferedAtpTypes(List<CluAtpTypeKey> offeredAtpTypes) { |
340 | 189 | this.offeredAtpTypes = offeredAtpTypes; |
341 | 189 | } |
342 | |
|
343 | |
public boolean isHasEarlyDropDeadline() { |
344 | 553 | return hasEarlyDropDeadline; |
345 | |
} |
346 | |
|
347 | |
public void setHasEarlyDropDeadline(boolean hasEarlyDropDeadline) { |
348 | 237 | this.hasEarlyDropDeadline = hasEarlyDropDeadline; |
349 | 237 | } |
350 | |
|
351 | |
public int getDefaultEnrollmentEstimate() { |
352 | 553 | return defaultEnrollmentEstimate; |
353 | |
} |
354 | |
|
355 | |
public void setDefaultEnrollmentEstimate(int defaultEnrollmentEstimate) { |
356 | 237 | this.defaultEnrollmentEstimate = defaultEnrollmentEstimate; |
357 | 237 | } |
358 | |
|
359 | |
public int getDefaultMaximumEnrollment() { |
360 | 553 | return defaultMaximumEnrollment; |
361 | |
} |
362 | |
|
363 | |
public void setDefaultMaximumEnrollment(int defaultMaximumEnrollment) { |
364 | 237 | this.defaultMaximumEnrollment = defaultMaximumEnrollment; |
365 | 237 | } |
366 | |
|
367 | |
public boolean isHazardousForDisabledStudents() { |
368 | 553 | return hazardousForDisabledStudents; |
369 | |
} |
370 | |
|
371 | |
public void setHazardousForDisabledStudents( |
372 | |
boolean hazardousForDisabledStudents) { |
373 | 237 | this.hazardousForDisabledStudents = hazardousForDisabledStudents; |
374 | 237 | } |
375 | |
|
376 | |
public CluFee getFee() { |
377 | 611 | return fee; |
378 | |
} |
379 | |
|
380 | |
public void setFee(CluFee fee) { |
381 | 36 | this.fee = fee; |
382 | 36 | } |
383 | |
|
384 | |
public CluAccounting getAccounting() { |
385 | 641 | return accounting; |
386 | |
} |
387 | |
|
388 | |
public void setAccounting(CluAccounting accounting) { |
389 | 26 | this.accounting = accounting; |
390 | 26 | } |
391 | |
|
392 | |
public String getState() { |
393 | 553 | return state; |
394 | |
} |
395 | |
|
396 | |
public void setState(String state) { |
397 | 237 | this.state = state; |
398 | 237 | } |
399 | |
|
400 | |
public CluInstructor getPrimaryInstructor() { |
401 | 709 | return primaryInstructor; |
402 | |
} |
403 | |
|
404 | |
public void setPrimaryInstructor(CluInstructor primaryInstructor) { |
405 | 26 | this.primaryInstructor = primaryInstructor; |
406 | 26 | } |
407 | |
|
408 | |
public List<CluCampusLocation> getCampusLocations() { |
409 | 2763 | return campusLocations; |
410 | |
} |
411 | |
|
412 | |
public void setCampusLocations(List<CluCampusLocation> campusLocationList) { |
413 | 189 | this.campusLocations = campusLocationList; |
414 | 189 | } |
415 | |
|
416 | |
public Amount getIntensity() { |
417 | 637 | return intensity; |
418 | |
} |
419 | |
|
420 | |
public void setIntensity(Amount intensity) { |
421 | 126 | this.intensity = intensity; |
422 | 126 | } |
423 | |
|
424 | |
public List<CluAccreditation> getAccreditations() { |
425 | 1593 | return accreditations; |
426 | |
} |
427 | |
|
428 | |
public void setAccreditations(List<CluAccreditation> accreditations) { |
429 | 189 | this.accreditations = accreditations; |
430 | 189 | } |
431 | |
|
432 | |
|
433 | |
public List<CluAdminOrg> getAdminOrgs() { |
434 | 1439 | return adminOrgs; |
435 | |
} |
436 | |
|
437 | |
public void setAdminOrgs(List<CluAdminOrg> adminOrgs) { |
438 | 237 | this.adminOrgs = adminOrgs; |
439 | 237 | } |
440 | |
|
441 | |
public String getExpectedFirstAtp() { |
442 | 553 | return expectedFirstAtp; |
443 | |
} |
444 | |
|
445 | |
public void setExpectedFirstAtp(String expectedFirstAtp) { |
446 | 237 | this.expectedFirstAtp = expectedFirstAtp; |
447 | 237 | } |
448 | |
|
449 | |
public String getLastAtp() { |
450 | 553 | return lastAtp; |
451 | |
} |
452 | |
|
453 | |
public void setLastAtp(String lastAtp) { |
454 | 237 | this.lastAtp = lastAtp; |
455 | 237 | } |
456 | |
|
457 | |
public String getLastAdmitAtp() { |
458 | 553 | return lastAdmitAtp; |
459 | |
} |
460 | |
|
461 | |
public void setLastAdmitAtp(String lastAdmitAtp) { |
462 | 237 | this.lastAdmitAtp = lastAdmitAtp; |
463 | 237 | } |
464 | |
} |