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