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_MLSTN") |
38 | |
@NamedQueries( { |
39 | |
@NamedQuery(name = "Milestone.findMilestonesByAtp", query = "SELECT milestone FROM Milestone milestone WHERE milestone.atp.id = :atpId"), |
40 | |
@NamedQuery(name = "Milestone.findMilestonesByDates", query = "SELECT milestone FROM Milestone milestone WHERE milestone.milestoneDate >= :startDate AND milestone.milestoneDate <= :endDate"), |
41 | |
@NamedQuery(name = "Milestone.findMilestonesByDatesAndType", query = "SELECT milestone FROM Milestone milestone WHERE milestone.type.id = :milestoneTypeId AND milestone.milestoneDate >= :startDate AND milestone.milestoneDate <= :endDate") |
42 | |
}) |
43 | 8 | public class Milestone extends MetaEntity implements |
44 | |
AttributeOwner<MilestoneAttribute> { |
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 | |
@ManyToOne |
54 | |
@JoinColumn(name = "ATP_ID") |
55 | |
private Atp atp; |
56 | |
|
57 | |
@Temporal(TemporalType.TIMESTAMP) |
58 | |
@Column(name="MLSTN_DT") |
59 | |
private Date milestoneDate; |
60 | |
|
61 | |
@OneToMany(cascade = CascadeType.ALL, mappedBy = "owner") |
62 | |
private List<MilestoneAttribute> attributes; |
63 | |
|
64 | |
@ManyToOne |
65 | |
@JoinColumn(name = "MLSTN_TYPE_ID") |
66 | |
private MilestoneType type; |
67 | |
|
68 | |
@Column(name="STATE") |
69 | |
private String state; |
70 | |
|
71 | |
public String getName() { |
72 | 5 | return name; |
73 | |
} |
74 | |
|
75 | |
public void setName(String name) { |
76 | 3 | this.name = name; |
77 | 3 | } |
78 | |
|
79 | |
public Atp getAtp() { |
80 | 5 | return atp; |
81 | |
} |
82 | |
|
83 | |
public void setAtp(Atp atp) { |
84 | 3 | this.atp = atp; |
85 | 3 | } |
86 | |
|
87 | |
public Date getMilestoneDate() { |
88 | 5 | return milestoneDate; |
89 | |
} |
90 | |
|
91 | |
public void setMilestoneDate(Date milestoneDate) { |
92 | 3 | this.milestoneDate = milestoneDate; |
93 | 3 | } |
94 | |
|
95 | |
public List<MilestoneAttribute> getAttributes() { |
96 | 11 | return attributes; |
97 | |
} |
98 | |
|
99 | |
public void setAttributes(List<MilestoneAttribute> attributes) { |
100 | 4 | this.attributes = attributes; |
101 | 4 | } |
102 | |
|
103 | |
public MilestoneType getType() { |
104 | 5 | return type; |
105 | |
} |
106 | |
|
107 | |
public void setType(MilestoneType type) { |
108 | 3 | this.type = type; |
109 | 3 | } |
110 | |
|
111 | |
public String getState() { |
112 | 5 | return state; |
113 | |
} |
114 | |
|
115 | |
public void setState(String state) { |
116 | 2 | this.state = state; |
117 | 2 | } |
118 | |
|
119 | |
public void setDescr(AtpRichText descr) { |
120 | 3 | this.descr = descr; |
121 | 3 | } |
122 | |
|
123 | |
public AtpRichText getDescr() { |
124 | 5 | return descr; |
125 | |
} |
126 | |
|
127 | |
} |