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