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