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