1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.lum.lu.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 | |
|
36 | |
@Entity |
37 | |
@Table(name = "KSLU_CLUCLU_RELTN") |
38 | |
@NamedQueries({ |
39 | |
@NamedQuery(name="CluCluRelation.getCluCluRelation", query="SELECT rel FROM CluCluRelation rel WHERE rel.clu.id = :cluId or rel.relatedClu.id = :cluId"), |
40 | |
@NamedQuery(name="CluCluRelation.getRelatedCluIdsByCluId", query="SELECT rel.relatedClu.id FROM CluCluRelation rel WHERE rel.clu.id = :cluId AND rel.luLuRelationType.id = :luLuRelationTypeId"), |
41 | |
@NamedQuery(name="CluCluRelation.getCluIdsByRelatedCluId", query = "SELECT rel.clu.id FROM CluCluRelation rel WHERE rel.relatedClu.id = :relatedCluId AND rel.luLuRelationType.id = :luLuRelationTypeId"), |
42 | |
@NamedQuery(name="CluCluRelation.getRelationTypeByCluId", query="SELECT distinct rel.luLuRelationType.id FROM CluCluRelation rel WHERE rel.clu.id = :cluId AND rel.relatedClu.id = :relatedCluId"), |
43 | |
@NamedQuery(name="CluCluRelation.getRelatedClusByCluId", query="SELECT rel.relatedClu FROM CluCluRelation rel WHERE rel.clu.id = :cluId AND rel.luLuRelationType.id = :luLuRelationTypeId"), |
44 | |
@NamedQuery(name="CluCluRelation.getClusByRelatedCluId", query="SELECT rel.clu FROM CluCluRelation rel WHERE rel.relatedClu.id = :relatedCluId AND rel.luLuRelationType.id = :luLuRelationTypeId") |
45 | |
}) |
46 | 0 | public class CluCluRelation extends MetaEntity implements |
47 | |
AttributeOwner<CluCluRelationAttribute> { |
48 | |
|
49 | |
@ManyToOne |
50 | |
@JoinColumn(name="CLU_ID") |
51 | |
private Clu clu; |
52 | |
|
53 | |
@ManyToOne |
54 | |
@JoinColumn(name="RELATED_CLU_ID") |
55 | |
private Clu relatedClu; |
56 | |
|
57 | |
@ManyToOne |
58 | |
@JoinColumn(name="LU_RELTN_TYPE_ID") |
59 | |
private LuLuRelationType luLuRelationType; |
60 | |
|
61 | |
@Column(name = "CLU_RELTN_REQ") |
62 | |
private boolean cluRelationRequired; |
63 | |
|
64 | |
@Temporal(TemporalType.TIMESTAMP) |
65 | |
@Column(name = "EFF_DT") |
66 | |
private Date effectiveDate; |
67 | |
|
68 | |
@Temporal(TemporalType.TIMESTAMP) |
69 | |
@Column(name = "EXPIR_DT") |
70 | |
private Date expirationDate; |
71 | |
|
72 | |
@Column(name = "ST") |
73 | |
private String state; |
74 | |
|
75 | |
@OneToMany(cascade = CascadeType.ALL, mappedBy = "owner") |
76 | |
private List<CluCluRelationAttribute> attributes; |
77 | |
|
78 | |
public Clu getClu() { |
79 | 0 | return clu; |
80 | |
} |
81 | |
|
82 | |
public void setClu(Clu clu) { |
83 | 0 | this.clu = clu; |
84 | 0 | } |
85 | |
|
86 | |
public Clu getRelatedClu() { |
87 | 0 | return relatedClu; |
88 | |
} |
89 | |
|
90 | |
public void setRelatedClu(Clu relatedClu) { |
91 | 0 | this.relatedClu = relatedClu; |
92 | 0 | } |
93 | |
|
94 | |
public LuLuRelationType getLuLuRelationType() { |
95 | 0 | return luLuRelationType; |
96 | |
} |
97 | |
|
98 | |
public void setLuLuRelationType(LuLuRelationType luLuRelationType) { |
99 | 0 | this.luLuRelationType = luLuRelationType; |
100 | 0 | } |
101 | |
|
102 | |
public boolean isCluRelationRequired() { |
103 | 0 | return cluRelationRequired; |
104 | |
} |
105 | |
|
106 | |
public void setCluRelationRequired(boolean cluRelationRequired) { |
107 | 0 | this.cluRelationRequired = cluRelationRequired; |
108 | 0 | } |
109 | |
|
110 | |
public Date getEffectiveDate() { |
111 | 0 | return effectiveDate; |
112 | |
} |
113 | |
|
114 | |
public void setEffectiveDate(Date effectiveDate) { |
115 | 0 | this.effectiveDate = effectiveDate; |
116 | 0 | } |
117 | |
|
118 | |
public Date getExpirationDate() { |
119 | 0 | return expirationDate; |
120 | |
} |
121 | |
|
122 | |
public void setExpirationDate(Date expirationDate) { |
123 | 0 | this.expirationDate = expirationDate; |
124 | 0 | } |
125 | |
|
126 | |
public String getState() { |
127 | 0 | return state; |
128 | |
} |
129 | |
|
130 | |
public void setState(String state) { |
131 | 0 | this.state = state; |
132 | 0 | } |
133 | |
|
134 | |
@Override |
135 | |
public List<CluCluRelationAttribute> getAttributes() { |
136 | 0 | return attributes; |
137 | |
} |
138 | |
|
139 | |
@Override |
140 | |
public void setAttributes(List<CluCluRelationAttribute> attributes) { |
141 | 0 | this.attributes = attributes; |
142 | 0 | } |
143 | |
} |