Clover Coverage Report - Kuali Student 1.2.1-SNAPSHOT (Aggregated)
Coverage timestamp: Wed Nov 2 2011 04:03:58 EST
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
62   464   62   1
0   348   1   62
62     1  
1    
 
  Clu       Line # 102 62 0% 62 0 100% 1.0
 
  (103)
 
1    /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10    * software distributed under the License is distributed on an "AS IS"
11    * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12    * or implied. See the License for the specific language governing
13    * permissions and limitations under the License.
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    //FIXME dates should be either set from the DB time as part of the insert statement, or set from the application.
48    //DB timestamp (CURRENT_TIMESTAMP) is preferred
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    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  747 toggle public LuType getLuType() {
214  747 return luType;
215    }
216   
 
217  237 toggle public void setLuType(LuType luType) {
218  237 this.luType = luType;
219    }
220   
 
221  1264 toggle @Override
222    public List<CluAttribute> getAttributes() {
223  1264 return attributes;
224    }
225   
 
226  426 toggle @Override
227    public void setAttributes(List<CluAttribute> attributes) {
228  426 this.attributes = attributes;
229    }
230   
 
231  933 toggle public CluIdentifier getOfficialIdentifier() {
232  933 return officialIdentifier;
233    }
234   
 
235  57 toggle public void setOfficialIdentifier(CluIdentifier officialIdentifier) {
236  57 this.officialIdentifier = officialIdentifier;
237    }
238   
 
239  728 toggle public List<CluIdentifier> getAlternateIdentifiers() {
240  728 return alternateIdentifiers;
241    }
242   
 
243  189 toggle public void setAlternateIdentifiers(List<CluIdentifier> alternateIdentifiers) {
244  189 this.alternateIdentifiers = alternateIdentifiers;
245    }
246   
 
247  553 toggle public String getStudySubjectArea() {
248  553 return studySubjectArea;
249    }
250   
 
251  237 toggle public void setStudySubjectArea(String studySubjectArea) {
252  237 this.studySubjectArea = studySubjectArea;
253    }
254   
 
255  647 toggle public LuRichText getDescr() {
256  647 return descr;
257    }
258   
 
259  57 toggle public void setDescr(LuRichText descr) {
260  57 this.descr = descr;
261    }
262   
 
263  1057 toggle public List<CluInstructor> getInstructors() {
264  1057 return instructors;
265    }
266   
 
267  189 toggle public void setInstructors(List<CluInstructor> instructors) {
268  189 this.instructors = instructors;
269    }
270   
 
271  553 toggle public Date getEffectiveDate() {
272  553 return effectiveDate;
273    }
274   
 
275  237 toggle public void setEffectiveDate(Date effectiveDate) {
276  237 this.effectiveDate = effectiveDate;
277    }
278   
 
279  553 toggle public Date getExpirationDate() {
280  553 return expirationDate;
281    }
282   
 
283  237 toggle public void setExpirationDate(Date expirationDate) {
284  237 this.expirationDate = expirationDate;
285    }
286   
 
287  638 toggle public TimeAmount getStdDuration() {
288  638 return stdDuration;
289    }
290   
 
291  169 toggle public void setStdDuration(TimeAmount stdDuration) {
292  169 this.stdDuration = stdDuration;
293    }
294   
 
295  553 toggle public boolean isCanCreateLui() {
296  553 return canCreateLui;
297    }
298   
 
299  237 toggle public void setCanCreateLui(boolean canCreateLui) {
300  237 this.canCreateLui = canCreateLui;
301    }
302   
 
303  553 toggle public String getReferenceURL() {
304  553 return referenceURL;
305    }
306   
 
307  237 toggle public void setReferenceURL(String referenceURL) {
308  237 this.referenceURL = referenceURL;
309    }
310   
 
311  1163 toggle public List<LuCode> getLuCodes() {
312  1163 return luCodes;
313    }
314   
 
315  189 toggle public void setLuCodes(List<LuCode> luCodes) {
316  189 this.luCodes = luCodes;
317    }
318   
 
319  553 toggle public String getNextReviewPeriod() {
320  553 return nextReviewPeriod;
321    }
322   
 
323  237 toggle public void setNextReviewPeriod(String nextReviewPeriod) {
324  237 this.nextReviewPeriod = nextReviewPeriod;
325    }
326   
 
327  553 toggle public boolean isEnrollable() {
328  553 return enrollable;
329    }
330   
 
331  237 toggle public void setEnrollable(boolean enrollable) {
332  237 this.enrollable = enrollable;
333    }
334   
 
335  2155 toggle public List<CluAtpTypeKey> getOfferedAtpTypes() {
336  2155 return offeredAtpTypes;
337    }
338   
 
339  189 toggle public void setOfferedAtpTypes(List<CluAtpTypeKey> offeredAtpTypes) {
340  189 this.offeredAtpTypes = offeredAtpTypes;
341    }
342   
 
343  553 toggle public boolean isHasEarlyDropDeadline() {
344  553 return hasEarlyDropDeadline;
345    }
346   
 
347  237 toggle public void setHasEarlyDropDeadline(boolean hasEarlyDropDeadline) {
348  237 this.hasEarlyDropDeadline = hasEarlyDropDeadline;
349    }
350   
 
351  553 toggle public int getDefaultEnrollmentEstimate() {
352  553 return defaultEnrollmentEstimate;
353    }
354   
 
355  237 toggle public void setDefaultEnrollmentEstimate(int defaultEnrollmentEstimate) {
356  237 this.defaultEnrollmentEstimate = defaultEnrollmentEstimate;
357    }
358   
 
359  553 toggle public int getDefaultMaximumEnrollment() {
360  553 return defaultMaximumEnrollment;
361    }
362   
 
363  237 toggle public void setDefaultMaximumEnrollment(int defaultMaximumEnrollment) {
364  237 this.defaultMaximumEnrollment = defaultMaximumEnrollment;
365    }
366   
 
367  553 toggle public boolean isHazardousForDisabledStudents() {
368  553 return hazardousForDisabledStudents;
369    }
370   
 
371  237 toggle public void setHazardousForDisabledStudents(
372    boolean hazardousForDisabledStudents) {
373  237 this.hazardousForDisabledStudents = hazardousForDisabledStudents;
374    }
375   
 
376  611 toggle public CluFee getFee() {
377  611 return fee;
378    }
379   
 
380  36 toggle public void setFee(CluFee fee) {
381  36 this.fee = fee;
382    }
383   
 
384  641 toggle public CluAccounting getAccounting() {
385  641 return accounting;
386    }
387   
 
388  26 toggle public void setAccounting(CluAccounting accounting) {
389  26 this.accounting = accounting;
390    }
391   
 
392  553 toggle public String getState() {
393  553 return state;
394    }
395   
 
396  237 toggle public void setState(String state) {
397  237 this.state = state;
398    }
399   
 
400  709 toggle public CluInstructor getPrimaryInstructor() {
401  709 return primaryInstructor;
402    }
403   
 
404  26 toggle public void setPrimaryInstructor(CluInstructor primaryInstructor) {
405  26 this.primaryInstructor = primaryInstructor;
406    }
407   
 
408  2763 toggle public List<CluCampusLocation> getCampusLocations() {
409  2763 return campusLocations;
410    }
411   
 
412  189 toggle public void setCampusLocations(List<CluCampusLocation> campusLocationList) {
413  189 this.campusLocations = campusLocationList;
414    }
415   
 
416  637 toggle public Amount getIntensity() {
417  637 return intensity;
418    }
419   
 
420  126 toggle public void setIntensity(Amount intensity) {
421  126 this.intensity = intensity;
422    }
423   
 
424  1593 toggle public List<CluAccreditation> getAccreditations() {
425  1593 return accreditations;
426    }
427   
 
428  189 toggle public void setAccreditations(List<CluAccreditation> accreditations) {
429  189 this.accreditations = accreditations;
430    }
431   
432   
 
433  1439 toggle public List<CluAdminOrg> getAdminOrgs() {
434  1439 return adminOrgs;
435    }
436   
 
437  237 toggle public void setAdminOrgs(List<CluAdminOrg> adminOrgs) {
438  237 this.adminOrgs = adminOrgs;
439    }
440   
 
441  553 toggle public String getExpectedFirstAtp() {
442  553 return expectedFirstAtp;
443    }
444   
 
445  237 toggle public void setExpectedFirstAtp(String expectedFirstAtp) {
446  237 this.expectedFirstAtp = expectedFirstAtp;
447    }
448   
 
449  553 toggle public String getLastAtp() {
450  553 return lastAtp;
451    }
452   
 
453  237 toggle public void setLastAtp(String lastAtp) {
454  237 this.lastAtp = lastAtp;
455    }
456   
 
457  553 toggle public String getLastAdmitAtp() {
458  553 return lastAdmitAtp;
459    }
460   
 
461  237 toggle public void setLastAdmitAtp(String lastAdmitAtp) {
462  237 this.lastAdmitAtp = lastAdmitAtp;
463    }
464    }