Clover Coverage Report - Kuali Student 1.2-SNAPSHOT (Aggregated)
Coverage timestamp: Thu Mar 3 2011 04:02:59 EST
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
62   462   62   1
0   347   1   62
62     1  
1    
 
  Clu       Line # 100 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    })
 
100    public class Clu extends VersionEntity implements AttributeOwner<CluAttribute> {
101   
102    @OneToOne(cascade=CascadeType.ALL)
103    @JoinColumn(name = "OFFIC_CLU_ID")
104    private CluIdentifier officialIdentifier;
105   
106    @OneToMany(cascade=CascadeType.ALL)
107    @JoinTable(name = "KSLU_CLU_JN_CLU_IDENT", joinColumns = @JoinColumn(name = "CLU_ID"), inverseJoinColumns = @JoinColumn(name = "ALT_CLU_ID"))
108    private List<CluIdentifier> alternateIdentifiers;
109   
110    @Column(name = "STDY_SUBJ_AREA")
111    private String studySubjectArea;
112   
113    @ManyToOne(cascade=CascadeType.ALL)
114    @JoinColumn(name = "RT_DESCR_ID")
115    private LuRichText descr;
116   
117    @OneToMany(cascade=CascadeType.ALL, mappedBy = "clu")
118    private List<CluCampusLocation> campusLocations;
119   
120    @OneToMany(cascade=CascadeType.ALL)
121    @JoinTable(name = "KSLU_CLU_JN_ACCRED", joinColumns = @JoinColumn(name = "CLU_ID"), inverseJoinColumns = @JoinColumn(name = "CLU_ACCRED_ID"))
122    private List<CluAccreditation> accreditations;
123   
124    @OneToMany(cascade = CascadeType.ALL, mappedBy = "clu")
125    private List<CluAdminOrg> adminOrgs;
126   
127    @ManyToOne(cascade=CascadeType.ALL)
128    @JoinColumn(name="PRI_INSTR_ID")
129    private CluInstructor primaryInstructor;
130   
131    @OneToMany(cascade=CascadeType.ALL)
132    @JoinTable(name = "KSLU_CLU_JN_CLU_INSTR", joinColumns = @JoinColumn(name = "CLU_ID"), inverseJoinColumns = @JoinColumn(name = "CLU_INSTR_ID"))
133    private List<CluInstructor> instructors;
134   
135    @Column(name = "EXP_FIRST_ATP")
136    private String expectedFirstAtp;
137   
138    @Column(name = "LAST_ATP")
139    private String lastAtp;
140   
141    @Column(name = "LAST_ADMIT_ATP")
142    private String lastAdmitAtp;
143   
144    @Temporal(TemporalType.TIMESTAMP)
145    @Column(name = "EFF_DT")
146    private Date effectiveDate;
147   
148    @Temporal(TemporalType.TIMESTAMP)
149    @Column(name = "EXPIR_DT")
150    private Date expirationDate;
151   
152    @Embedded
153    @AttributeOverrides({
154    @AttributeOverride(name="unitType", column=@Column(name="CLU_INTSTY_TYPE")),
155    @AttributeOverride(name="unitQuantity", column=@Column(name="CLU_INTSTY_QTY")
156    )})
157    private Amount intensity;
158   
159    @Embedded
160    @Column(name = "STD_DUR")
161    private TimeAmount stdDuration;
162   
163    @Column(name = "CAN_CREATE_LUI")
164    private boolean canCreateLui;
165   
166    @Column(name = "REF_URL")
167    private String referenceURL;
168   
169    @OneToMany(cascade = CascadeType.ALL, mappedBy="clu")
170    private List<LuCode> luCodes;
171   
172    @Column(name = "NEXT_REVIEW_PRD")
173    private String nextReviewPeriod;
174   
175    @Column(name = "IS_ENRL")
176    private boolean enrollable;
177   
178    @OneToMany(cascade=CascadeType.ALL, mappedBy="clu")
179    private List<CluAtpTypeKey> offeredAtpTypes;
180   
181    @Column(name = "HAS_EARLY_DROP_DEDLN")
182    private boolean hasEarlyDropDeadline;
183   
184    @Column(name = "DEF_ENRL_EST")
185    private int defaultEnrollmentEstimate;
186   
187    @Column(name = "DEF_MAX_ENRL")
188    private int defaultMaximumEnrollment;
189   
190    @Column(name = "IS_HAZR_DISBLD_STU")
191    private boolean hazardousForDisabledStudents;
192   
193    @OneToOne(cascade=CascadeType.ALL)
194    @JoinColumn(name = "FEE_ID")
195    private CluFee fee;
196   
197    @OneToOne(cascade=CascadeType.ALL)
198    @JoinColumn(name = "ACCT_ID")
199    private CluAccounting accounting;
200   
201    @OneToMany(cascade = CascadeType.ALL, mappedBy = "owner")
202    private List<CluAttribute> attributes;
203   
204    @ManyToOne
205    @JoinColumn(name = "LUTYPE_ID")
206    private LuType luType;
207   
208    @Column(name = "ST")
209    private String state;
210   
 
211  747 toggle public LuType getLuType() {
212  747 return luType;
213    }
214   
 
215  237 toggle public void setLuType(LuType luType) {
216  237 this.luType = luType;
217    }
218   
 
219  1264 toggle @Override
220    public List<CluAttribute> getAttributes() {
221  1264 return attributes;
222    }
223   
 
224  426 toggle @Override
225    public void setAttributes(List<CluAttribute> attributes) {
226  426 this.attributes = attributes;
227    }
228   
 
229  933 toggle public CluIdentifier getOfficialIdentifier() {
230  933 return officialIdentifier;
231    }
232   
 
233  57 toggle public void setOfficialIdentifier(CluIdentifier officialIdentifier) {
234  57 this.officialIdentifier = officialIdentifier;
235    }
236   
 
237  728 toggle public List<CluIdentifier> getAlternateIdentifiers() {
238  728 return alternateIdentifiers;
239    }
240   
 
241  189 toggle public void setAlternateIdentifiers(List<CluIdentifier> alternateIdentifiers) {
242  189 this.alternateIdentifiers = alternateIdentifiers;
243    }
244   
 
245  553 toggle public String getStudySubjectArea() {
246  553 return studySubjectArea;
247    }
248   
 
249  237 toggle public void setStudySubjectArea(String studySubjectArea) {
250  237 this.studySubjectArea = studySubjectArea;
251    }
252   
 
253  647 toggle public LuRichText getDescr() {
254  647 return descr;
255    }
256   
 
257  57 toggle public void setDescr(LuRichText descr) {
258  57 this.descr = descr;
259    }
260   
 
261  1057 toggle public List<CluInstructor> getInstructors() {
262  1057 return instructors;
263    }
264   
 
265  189 toggle public void setInstructors(List<CluInstructor> instructors) {
266  189 this.instructors = instructors;
267    }
268   
 
269  553 toggle public Date getEffectiveDate() {
270  553 return effectiveDate;
271    }
272   
 
273  237 toggle public void setEffectiveDate(Date effectiveDate) {
274  237 this.effectiveDate = effectiveDate;
275    }
276   
 
277  553 toggle public Date getExpirationDate() {
278  553 return expirationDate;
279    }
280   
 
281  237 toggle public void setExpirationDate(Date expirationDate) {
282  237 this.expirationDate = expirationDate;
283    }
284   
 
285  638 toggle public TimeAmount getStdDuration() {
286  638 return stdDuration;
287    }
288   
 
289  169 toggle public void setStdDuration(TimeAmount stdDuration) {
290  169 this.stdDuration = stdDuration;
291    }
292   
 
293  553 toggle public boolean isCanCreateLui() {
294  553 return canCreateLui;
295    }
296   
 
297  237 toggle public void setCanCreateLui(boolean canCreateLui) {
298  237 this.canCreateLui = canCreateLui;
299    }
300   
 
301  553 toggle public String getReferenceURL() {
302  553 return referenceURL;
303    }
304   
 
305  237 toggle public void setReferenceURL(String referenceURL) {
306  237 this.referenceURL = referenceURL;
307    }
308   
 
309  1163 toggle public List<LuCode> getLuCodes() {
310  1163 return luCodes;
311    }
312   
 
313  189 toggle public void setLuCodes(List<LuCode> luCodes) {
314  189 this.luCodes = luCodes;
315    }
316   
 
317  553 toggle public String getNextReviewPeriod() {
318  553 return nextReviewPeriod;
319    }
320   
 
321  237 toggle public void setNextReviewPeriod(String nextReviewPeriod) {
322  237 this.nextReviewPeriod = nextReviewPeriod;
323    }
324   
 
325  553 toggle public boolean isEnrollable() {
326  553 return enrollable;
327    }
328   
 
329  237 toggle public void setEnrollable(boolean enrollable) {
330  237 this.enrollable = enrollable;
331    }
332   
 
333  2155 toggle public List<CluAtpTypeKey> getOfferedAtpTypes() {
334  2155 return offeredAtpTypes;
335    }
336   
 
337  189 toggle public void setOfferedAtpTypes(List<CluAtpTypeKey> offeredAtpTypes) {
338  189 this.offeredAtpTypes = offeredAtpTypes;
339    }
340   
 
341  553 toggle public boolean isHasEarlyDropDeadline() {
342  553 return hasEarlyDropDeadline;
343    }
344   
 
345  237 toggle public void setHasEarlyDropDeadline(boolean hasEarlyDropDeadline) {
346  237 this.hasEarlyDropDeadline = hasEarlyDropDeadline;
347    }
348   
 
349  553 toggle public int getDefaultEnrollmentEstimate() {
350  553 return defaultEnrollmentEstimate;
351    }
352   
 
353  237 toggle public void setDefaultEnrollmentEstimate(int defaultEnrollmentEstimate) {
354  237 this.defaultEnrollmentEstimate = defaultEnrollmentEstimate;
355    }
356   
 
357  553 toggle public int getDefaultMaximumEnrollment() {
358  553 return defaultMaximumEnrollment;
359    }
360   
 
361  237 toggle public void setDefaultMaximumEnrollment(int defaultMaximumEnrollment) {
362  237 this.defaultMaximumEnrollment = defaultMaximumEnrollment;
363    }
364   
 
365  553 toggle public boolean isHazardousForDisabledStudents() {
366  553 return hazardousForDisabledStudents;
367    }
368   
 
369  237 toggle public void setHazardousForDisabledStudents(
370    boolean hazardousForDisabledStudents) {
371  237 this.hazardousForDisabledStudents = hazardousForDisabledStudents;
372    }
373   
 
374  611 toggle public CluFee getFee() {
375  611 return fee;
376    }
377   
 
378  36 toggle public void setFee(CluFee fee) {
379  36 this.fee = fee;
380    }
381   
 
382  641 toggle public CluAccounting getAccounting() {
383  641 return accounting;
384    }
385   
 
386  26 toggle public void setAccounting(CluAccounting accounting) {
387  26 this.accounting = accounting;
388    }
389   
 
390  553 toggle public String getState() {
391  553 return state;
392    }
393   
 
394  237 toggle public void setState(String state) {
395  237 this.state = state;
396    }
397   
 
398  709 toggle public CluInstructor getPrimaryInstructor() {
399  709 return primaryInstructor;
400    }
401   
 
402  26 toggle public void setPrimaryInstructor(CluInstructor primaryInstructor) {
403  26 this.primaryInstructor = primaryInstructor;
404    }
405   
 
406  2763 toggle public List<CluCampusLocation> getCampusLocations() {
407  2763 return campusLocations;
408    }
409   
 
410  189 toggle public void setCampusLocations(List<CluCampusLocation> campusLocationList) {
411  189 this.campusLocations = campusLocationList;
412    }
413   
 
414  637 toggle public Amount getIntensity() {
415  637 return intensity;
416    }
417   
 
418  126 toggle public void setIntensity(Amount intensity) {
419  126 this.intensity = intensity;
420    }
421   
 
422  1593 toggle public List<CluAccreditation> getAccreditations() {
423  1593 return accreditations;
424    }
425   
 
426  189 toggle public void setAccreditations(List<CluAccreditation> accreditations) {
427  189 this.accreditations = accreditations;
428    }
429   
430   
 
431  1439 toggle public List<CluAdminOrg> getAdminOrgs() {
432  1439 return adminOrgs;
433    }
434   
 
435  237 toggle public void setAdminOrgs(List<CluAdminOrg> adminOrgs) {
436  237 this.adminOrgs = adminOrgs;
437    }
438   
 
439  553 toggle public String getExpectedFirstAtp() {
440  553 return expectedFirstAtp;
441    }
442   
 
443  237 toggle public void setExpectedFirstAtp(String expectedFirstAtp) {
444  237 this.expectedFirstAtp = expectedFirstAtp;
445    }
446   
 
447  553 toggle public String getLastAtp() {
448  553 return lastAtp;
449    }
450   
 
451  237 toggle public void setLastAtp(String lastAtp) {
452  237 this.lastAtp = lastAtp;
453    }
454   
 
455  553 toggle public String getLastAdmitAtp() {
456  553 return lastAdmitAtp;
457    }
458   
 
459  237 toggle public void setLastAdmitAtp(String lastAdmitAtp) {
460  237 this.lastAdmitAtp = lastAdmitAtp;
461    }
462    }