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_CLU_LO_RELTN") |
38 | |
@NamedQueries({ |
39 | |
@NamedQuery(name="CluLoRelation.getCluLoRelation", query="SELECT rel FROM CluLoRelation rel WHERE rel.clu.id = :cluId and rel.loId = :loId"), |
40 | |
@NamedQuery(name="CluLoRelation.getCluLoRelationByClu", query="SELECT rel FROM CluLoRelation rel WHERE rel.clu.id = :cluId"), |
41 | |
@NamedQuery(name="CluLoRelation.getCluLoRelationByLo", query="SELECT rel FROM CluLoRelation rel WHERE rel.loId = :loId"), |
42 | |
@NamedQuery(name="CluLoRelation.getCluLoRelationByCluIdAndType", query="SELECT rel.id FROM CluLoRelation rel WHERE rel.clu.id = :cluId AND rel.type.id = :cluLoRelationType") |
43 | |
}) |
44 | 209 | public class CluLoRelation extends MetaEntity implements |
45 | |
AttributeOwner<CluLoRelationAttribute> { |
46 | |
|
47 | |
@ManyToOne |
48 | |
@JoinColumn(name="CLU_ID") |
49 | |
private Clu clu; |
50 | |
|
51 | |
@Column(name="LO_ID") |
52 | |
private String loId; |
53 | |
|
54 | |
@Temporal(TemporalType.TIMESTAMP) |
55 | |
@Column(name = "EFF_DT") |
56 | |
private Date effectiveDate; |
57 | |
|
58 | |
@Temporal(TemporalType.TIMESTAMP) |
59 | |
@Column(name = "EXPIR_DT") |
60 | |
private Date expirationDate; |
61 | |
|
62 | |
@OneToMany(cascade = CascadeType.ALL, mappedBy = "owner") |
63 | |
private List<CluLoRelationAttribute> attributes; |
64 | |
|
65 | |
@ManyToOne |
66 | |
@JoinColumn(name = "TYPE") |
67 | |
private CluLoRelationType type; |
68 | |
|
69 | |
@Column(name = "ST") |
70 | |
private String state; |
71 | |
|
72 | |
@Override |
73 | |
public List<CluLoRelationAttribute> getAttributes() { |
74 | 516 | return attributes; |
75 | |
} |
76 | |
|
77 | |
@Override |
78 | |
public void setAttributes(List<CluLoRelationAttribute> attributes) { |
79 | 203 | this.attributes = attributes; |
80 | 203 | } |
81 | |
|
82 | |
public Clu getClu() { |
83 | 210 | return clu; |
84 | |
} |
85 | |
|
86 | |
public void setClu(Clu clu) { |
87 | 102 | this.clu = clu; |
88 | 102 | } |
89 | |
|
90 | |
public String getLoId() { |
91 | 210 | return loId; |
92 | |
} |
93 | |
|
94 | |
public void setLoId(String loId) { |
95 | 102 | this.loId = loId; |
96 | 102 | } |
97 | |
|
98 | |
public Date getEffectiveDate() { |
99 | 210 | return effectiveDate; |
100 | |
} |
101 | |
|
102 | |
public void setEffectiveDate(Date effectiveDate) { |
103 | 102 | this.effectiveDate = effectiveDate; |
104 | 102 | } |
105 | |
|
106 | |
public Date getExpirationDate() { |
107 | 210 | return expirationDate; |
108 | |
} |
109 | |
|
110 | |
public void setExpirationDate(Date expirationDate) { |
111 | 102 | this.expirationDate = expirationDate; |
112 | 102 | } |
113 | |
|
114 | |
public CluLoRelationType getType() { |
115 | 210 | return type; |
116 | |
} |
117 | |
|
118 | |
public void setType(CluLoRelationType type) { |
119 | 102 | this.type = type; |
120 | 102 | } |
121 | |
|
122 | |
public String getState() { |
123 | 210 | return state; |
124 | |
} |
125 | |
|
126 | |
public void setState(String state) { |
127 | 102 | this.state = state; |
128 | 102 | } |
129 | |
} |