1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.core.atp.bo; |
17 | |
|
18 | |
import java.util.ArrayList; |
19 | |
import java.util.Date; |
20 | |
import java.util.List; |
21 | |
|
22 | |
import javax.persistence.CascadeType; |
23 | |
import javax.persistence.Column; |
24 | |
import javax.persistence.Entity; |
25 | |
import javax.persistence.JoinColumn; |
26 | |
import javax.persistence.ManyToOne; |
27 | |
import javax.persistence.NamedQueries; |
28 | |
import javax.persistence.NamedQuery; |
29 | |
import javax.persistence.OneToMany; |
30 | |
import javax.persistence.Table; |
31 | |
import javax.persistence.Temporal; |
32 | |
import javax.persistence.TemporalType; |
33 | |
|
34 | |
import org.kuali.student.core.bo.KsTypeStateBusinessObjectBase; |
35 | |
|
36 | |
@Entity |
37 | |
@Table(name = "KSAP_ATP") |
38 | |
@NamedQueries( { |
39 | |
@NamedQuery(name = "Atp.findAtpsByAtpType", query = "SELECT atp FROM Atp atp WHERE atp.type.id = :atpTypeId"), |
40 | |
@NamedQuery(name = "Atp.findAtpsByDate", query = "SELECT atp FROM Atp atp WHERE atp.effectiveDate <= :searchDate AND atp.expirationDate > :searchDate"), |
41 | |
@NamedQuery(name = "Atp.findAtpsByDates", query = "SELECT atp FROM Atp atp WHERE atp.effectiveDate >= :startDate AND atp.expirationDate <= :endDate") |
42 | |
}) |
43 | |
public class Atp extends KsTypeStateBusinessObjectBase { |
44 | |
private static final long serialVersionUID = -4021959685737332345L; |
45 | |
|
46 | |
@ManyToOne |
47 | |
@JoinColumn(name = "TYPE") |
48 | |
private AtpType type; |
49 | |
|
50 | |
@Temporal(TemporalType.TIMESTAMP) |
51 | |
@Column(name="START_DT") |
52 | |
private Date startDate; |
53 | |
|
54 | |
@Temporal(TemporalType.TIMESTAMP) |
55 | |
@Column(name="END_DT") |
56 | |
private Date endDate; |
57 | |
|
58 | |
private String descriptionId; |
59 | |
|
60 | |
private AtpRichText description; |
61 | |
|
62 | |
@OneToMany(mappedBy = "atp", cascade = CascadeType.REMOVE) |
63 | |
private List<DateRange> dateRanges; |
64 | |
|
65 | |
@OneToMany(mappedBy = "atp", cascade = CascadeType.REMOVE) |
66 | |
private List<Milestone> milestones; |
67 | |
|
68 | |
public Atp() { |
69 | 0 | super(); |
70 | 0 | dateRanges = new ArrayList<DateRange>(); |
71 | 0 | milestones = new ArrayList<Milestone>(); |
72 | |
|
73 | 0 | } |
74 | |
|
75 | |
|
76 | |
public AtpType getType() { |
77 | 0 | return type; |
78 | |
} |
79 | |
|
80 | |
public void setType(AtpType type) { |
81 | 0 | this.type = type; |
82 | 0 | } |
83 | |
|
84 | |
public Date getStartDate() { |
85 | 0 | return startDate; |
86 | |
} |
87 | |
|
88 | |
public void setStartDate(Date startDate) { |
89 | 0 | this.startDate = startDate; |
90 | 0 | } |
91 | |
|
92 | |
public Date getEndDate() { |
93 | 0 | return endDate; |
94 | |
} |
95 | |
|
96 | |
public void setEndDate(Date endDate) { |
97 | 0 | this.endDate = endDate; |
98 | 0 | } |
99 | |
|
100 | |
public String getDescriptionId() { |
101 | 0 | return descriptionId; |
102 | |
} |
103 | |
|
104 | |
public void setDescriptionId(String descriptionId) { |
105 | 0 | this.descriptionId = descriptionId; |
106 | 0 | } |
107 | |
|
108 | |
public AtpRichText getDescription() { |
109 | 0 | return description; |
110 | |
} |
111 | |
|
112 | |
public void setDescription(AtpRichText description) { |
113 | 0 | this.description = description; |
114 | 0 | } |
115 | |
|
116 | |
public List<DateRange> getDateRanges() { |
117 | 0 | return dateRanges; |
118 | |
} |
119 | |
|
120 | |
public void setDateRanges(List<DateRange> dateRanges) { |
121 | 0 | this.dateRanges = dateRanges; |
122 | 0 | } |
123 | |
|
124 | |
public List<Milestone> getMilestones() { |
125 | 0 | return milestones; |
126 | |
} |
127 | |
|
128 | |
public void setMilestones(List<Milestone> milestones) { |
129 | 0 | this.milestones = milestones; |
130 | 0 | } |
131 | |
|
132 | |
} |