1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.core.statement.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.FetchType; |
25 | |
import javax.persistence.JoinColumn; |
26 | |
import javax.persistence.JoinTable; |
27 | |
import javax.persistence.ManyToOne; |
28 | |
import javax.persistence.NamedQueries; |
29 | |
import javax.persistence.NamedQuery; |
30 | |
import javax.persistence.OneToMany; |
31 | |
import javax.persistence.Table; |
32 | |
import javax.persistence.Temporal; |
33 | |
import javax.persistence.TemporalType; |
34 | |
|
35 | |
import org.kuali.student.core.entity.MetaEntity; |
36 | |
|
37 | |
@Entity |
38 | |
@Table(name="KSST_REQ_COM") |
39 | |
@NamedQueries( { |
40 | |
@NamedQuery(name = "ReqComponent.getReqComponentsByType", query = "SELECT r FROM ReqComponent r WHERE r.requiredComponentType.id = :reqComponentTypeKey"), |
41 | |
@NamedQuery(name = "ReqComponent.getReqComponents", query = "SELECT r FROM ReqComponent r WHERE r.id IN (:reqComponentIdList)") |
42 | |
}) |
43 | 119 | public class ReqComponent extends MetaEntity { |
44 | |
|
45 | |
@ManyToOne(cascade=CascadeType.ALL) |
46 | |
@JoinColumn(name = "RT_DESCR_ID") |
47 | |
private StatementRichText descr; |
48 | |
|
49 | |
@Column(name="ST") |
50 | |
private String state; |
51 | |
|
52 | |
@Temporal(TemporalType.TIMESTAMP) |
53 | |
@Column(name = "EFF_DT") |
54 | |
private Date effectiveDate; |
55 | |
|
56 | |
@Temporal(TemporalType.TIMESTAMP) |
57 | |
@Column(name = "EXPIR_DT") |
58 | |
private Date expirationDate; |
59 | |
|
60 | |
@ManyToOne |
61 | |
@JoinColumn(name="REQ_COM_TYPE_ID") |
62 | |
private ReqComponentType requiredComponentType; |
63 | |
|
64 | |
@OneToMany(cascade = {CascadeType.ALL}, fetch = FetchType.EAGER) |
65 | |
@JoinTable(name = "KSST_RC_JN_RC_FIELD", joinColumns = @JoinColumn(name = "REQ_COM_ID"), inverseJoinColumns = @JoinColumn(name = "REQ_COM_FIELD_ID")) |
66 | |
private List<ReqComponentField> reqComponentFields; |
67 | |
|
68 | |
public ReqComponentType getRequiredComponentType() { |
69 | 160 | return requiredComponentType; |
70 | |
} |
71 | |
|
72 | |
public void setRequiredComponentType(ReqComponentType requiredComponentType) { |
73 | 50 | this.requiredComponentType = requiredComponentType; |
74 | 50 | } |
75 | |
|
76 | |
public StatementRichText getDescr() { |
77 | 95 | return descr; |
78 | |
} |
79 | |
|
80 | |
public void setDescr(StatementRichText descr) { |
81 | 12 | this.descr = descr; |
82 | 12 | } |
83 | |
|
84 | |
public String getState() { |
85 | 95 | return state; |
86 | |
} |
87 | |
|
88 | |
public void setState(String state) { |
89 | 12 | this.state = state; |
90 | 12 | } |
91 | |
|
92 | |
public Date getEffectiveDate() { |
93 | 95 | return effectiveDate; |
94 | |
} |
95 | |
|
96 | |
public void setEffectiveDate(Date effectiveDate) { |
97 | 12 | this.effectiveDate = effectiveDate; |
98 | 12 | } |
99 | |
|
100 | |
public Date getExpirationDate() { |
101 | 95 | return expirationDate; |
102 | |
} |
103 | |
|
104 | |
public void setExpirationDate(Date expirationDate) { |
105 | 12 | this.expirationDate = expirationDate; |
106 | 12 | } |
107 | |
|
108 | |
public List<ReqComponentField> getReqComponentFields() { |
109 | 101 | return reqComponentFields; |
110 | |
} |
111 | |
|
112 | |
public void setReqComponentFields(List<ReqComponentField> reqCompField) { |
113 | 52 | this.reqComponentFields = reqCompField; |
114 | 52 | } |
115 | |
|
116 | |
@Override |
117 | |
public String toString() { |
118 | 0 | return "ReqComponent[id=" + getId() + ", requiredComponentTypeId=" |
119 | |
+ (requiredComponentType == null ? "null" : requiredComponentType.getId()) + "]"; |
120 | |
} |
121 | |
|
122 | |
} |