1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.core.organization.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.JoinTable; |
26 | |
import javax.persistence.ManyToMany; |
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.AttributeOwner; |
36 | |
import org.kuali.student.common.entity.KSEntityConstants; |
37 | |
import org.kuali.student.common.entity.MetaEntity; |
38 | |
@Entity |
39 | |
@Table(name="KSOR_ORG") |
40 | |
@NamedQueries({ |
41 | |
@NamedQuery(name="Org.getOrganizationsByIdList", query="SELECT o FROM Org o WHERE o.id IN (:orgIdList)"), |
42 | |
@NamedQuery(name = "Org.getOrgByRelatedOrgAndType", query = "SELECT oor.org FROM OrgOrgRelation oor WHERE oor.relatedOrg.id = :relatedOrgId AND oor.type.id = :relationTypeKey") |
43 | |
}) |
44 | 0 | public class Org extends MetaEntity implements AttributeOwner<OrgAttribute>{ |
45 | |
|
46 | |
@Column(name = "LNG_NAME") |
47 | |
private String longName; |
48 | |
|
49 | |
@Column(name = "SHRT_NAME") |
50 | |
private String shortName; |
51 | |
|
52 | |
@Column(name = "SHRT_DESCR",length=KSEntityConstants.SHORT_TEXT_LENGTH) |
53 | |
private String shortDesc; |
54 | |
|
55 | |
@Column(name = "LNG_DESCR",length=KSEntityConstants.LONG_TEXT_LENGTH) |
56 | |
private String longDesc; |
57 | |
|
58 | |
@Temporal(TemporalType.TIMESTAMP) |
59 | |
@Column(name = "EFF_DT") |
60 | |
private Date effectiveDate; |
61 | |
|
62 | |
@Temporal(TemporalType.TIMESTAMP) |
63 | |
@Column(name = "EXPIR_DT") |
64 | |
private Date expirationDate; |
65 | |
|
66 | |
@OneToMany(cascade = CascadeType.ALL, mappedBy = "owner") |
67 | |
private List<OrgAttribute> attributes; |
68 | |
|
69 | |
@ManyToOne |
70 | |
@JoinColumn(name="TYPE") |
71 | |
private OrgType type; |
72 | |
|
73 | |
@ManyToMany |
74 | |
@JoinTable( |
75 | |
name="KSOR_ORG_JN_ORG_PERS_REL_TYPE", |
76 | |
joinColumns= |
77 | |
@JoinColumn(name="ORG_ID", referencedColumnName="ID"), |
78 | |
inverseJoinColumns= |
79 | |
@JoinColumn(name="ORG_PERS_RELTN_TYPE_ID", referencedColumnName="TYPE_KEY") |
80 | |
) |
81 | |
private List<OrgPersonRelationType> orgPersonRelationTypes; |
82 | |
|
83 | |
@Column(name = "ST") |
84 | |
private String state; |
85 | |
|
86 | |
@Override |
87 | |
public List<OrgAttribute> getAttributes() { |
88 | 0 | return attributes; |
89 | |
} |
90 | |
|
91 | |
@Override |
92 | |
public void setAttributes(List<OrgAttribute> attributes) { |
93 | 0 | this.attributes=attributes; |
94 | 0 | } |
95 | |
|
96 | |
public String getLongName() { |
97 | 0 | return longName; |
98 | |
} |
99 | |
|
100 | |
public void setLongName(String longName) { |
101 | 0 | this.longName = longName; |
102 | 0 | } |
103 | |
|
104 | |
public String getShortName() { |
105 | 0 | return shortName; |
106 | |
} |
107 | |
|
108 | |
public void setShortName(String shortName) { |
109 | 0 | this.shortName = shortName; |
110 | 0 | } |
111 | |
|
112 | |
public Date getEffectiveDate() { |
113 | 0 | return effectiveDate; |
114 | |
} |
115 | |
|
116 | |
public void setEffectiveDate(Date effectiveDate) { |
117 | 0 | this.effectiveDate = effectiveDate; |
118 | 0 | } |
119 | |
|
120 | |
public Date getExpirationDate() { |
121 | 0 | return expirationDate; |
122 | |
} |
123 | |
|
124 | |
public void setExpirationDate(Date expirationDate) { |
125 | 0 | this.expirationDate = expirationDate; |
126 | 0 | } |
127 | |
|
128 | |
public OrgType getType() { |
129 | 0 | return type; |
130 | |
} |
131 | |
|
132 | |
public void setType(OrgType type) { |
133 | 0 | this.type = type; |
134 | 0 | } |
135 | |
|
136 | |
public String getState() { |
137 | 0 | return state; |
138 | |
} |
139 | |
|
140 | |
public void setState(String state) { |
141 | 0 | this.state = state; |
142 | 0 | } |
143 | |
|
144 | |
public List<OrgPersonRelationType> getOrgPersonRelationTypes() { |
145 | 0 | return orgPersonRelationTypes; |
146 | |
} |
147 | |
|
148 | |
public void setOrgPersonRelationTypes(List<OrgPersonRelationType> orgPersonRelationTypes) { |
149 | 0 | this.orgPersonRelationTypes = orgPersonRelationTypes; |
150 | 0 | } |
151 | |
|
152 | |
public void setShortDesc(String shortDesc) { |
153 | 0 | this.shortDesc = shortDesc; |
154 | 0 | } |
155 | |
|
156 | |
public String getShortDesc() { |
157 | 0 | return shortDesc; |
158 | |
} |
159 | |
|
160 | |
public void setLongDesc(String longDesc) { |
161 | 0 | this.longDesc = longDesc; |
162 | 0 | } |
163 | |
|
164 | |
public String getLongDesc() { |
165 | 0 | return longDesc; |
166 | |
} |
167 | |
} |