1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.core.atp.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 @Entity
36 @Table(name = "KSAP_ATP")
37 @NamedQueries( {
38 @NamedQuery(name = "Atp.findAtpsByAtpType", query = "SELECT atp FROM Atp atp WHERE atp.type.id = :atpTypeId"),
39 @NamedQuery(name = "Atp.findAtpsByDate", query = "SELECT atp FROM Atp atp WHERE atp.startDate <= :searchDate AND atp.endDate > :searchDate"),
40 @NamedQuery(name = "Atp.findAtpsByDates", query = "SELECT atp FROM Atp atp WHERE atp.startDate >= :startDate AND atp.endDate <= :endDate")
41 })
42 public class Atp extends MetaEntity implements AttributeOwner<AtpAttribute> {
43
44
45 @Column(name = "NAME")
46 private String name;
47
48 @ManyToOne(cascade = CascadeType.ALL)
49 @JoinColumn(name = "RT_DESCR_ID")
50 private AtpRichText descr;
51
52 @Temporal(TemporalType.TIMESTAMP)
53 @Column(name = "START_DT")
54 private Date startDate;
55
56 @Temporal(TemporalType.TIMESTAMP)
57 @Column(name = "END_DT")
58 private Date endDate;
59
60 @OneToMany(cascade = CascadeType.ALL, mappedBy = "owner")
61 private List<AtpAttribute> attributes;
62
63 @ManyToOne
64 @JoinColumn(name = "TYPE")
65 private AtpType type;
66
67 @Column(name = "STATE")
68 private String state;
69
70 @OneToMany(mappedBy = "atp", cascade = CascadeType.REMOVE)
71 private List<DateRange> dateRanges;
72
73 @OneToMany(mappedBy = "atp", cascade = CascadeType.REMOVE)
74 private List<Milestone> milestones;
75
76 public String getName() {
77 return name;
78 }
79
80 public void setName(String name) {
81 this.name = name;
82 }
83
84 public AtpRichText getDescr() {
85 return descr;
86 }
87
88 public void setDescr(AtpRichText descr) {
89 this.descr = descr;
90 }
91
92 public Date getStartDate() {
93 return startDate;
94 }
95
96 public void setStartDate(Date startDate) {
97 this.startDate = startDate;
98 }
99
100 public Date getEndDate() {
101 return endDate;
102 }
103
104 public void setEndDate(Date endDate) {
105 this.endDate = endDate;
106 }
107
108 public List<AtpAttribute> getAttributes() {
109 return attributes;
110 }
111
112 public void setAttributes(List<AtpAttribute> attributes) {
113 this.attributes = attributes;
114 }
115
116 public AtpType getType() {
117 return type;
118 }
119
120 public void setType(AtpType type) {
121 this.type = type;
122 }
123
124 public String getState() {
125 return state;
126 }
127
128 public void setState(String state) {
129 this.state = state;
130 }
131
132 public List<DateRange> getDateRanges() {
133 return dateRanges;
134 }
135
136 public void setDateRanges(List<DateRange> dateRanges) {
137 this.dateRanges = dateRanges;
138 }
139
140 public List<Milestone> getMilestones() {
141 return milestones;
142 }
143
144 public void setMilestones(List<Milestone> milestones) {
145 this.milestones = milestones;
146 }
147
148 }