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