1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kim.bo.entity.impl; |
17 | |
|
18 | |
import java.util.LinkedHashMap; |
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.FetchType; |
25 | |
import javax.persistence.Id; |
26 | |
import javax.persistence.JoinColumn; |
27 | |
import javax.persistence.ManyToOne; |
28 | |
import javax.persistence.OneToMany; |
29 | |
import javax.persistence.Table; |
30 | |
|
31 | |
import org.kuali.rice.kim.bo.entity.KimEntityAddress; |
32 | |
import org.kuali.rice.kim.bo.entity.KimEntityEmail; |
33 | |
import org.kuali.rice.kim.bo.entity.KimEntityEntityType; |
34 | |
import org.kuali.rice.kim.bo.entity.KimEntityPhone; |
35 | |
import org.kuali.rice.kim.bo.reference.EntityType; |
36 | |
import org.kuali.rice.kim.bo.reference.impl.EntityTypeImpl; |
37 | |
import org.kuali.rice.kns.util.TypedArrayList; |
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
@Entity |
43 | |
@Table(name = "KRIM_ENTITY_ENT_TYP_T") |
44 | 0 | public class KimEntityEntityTypeImpl extends KimInactivatableEntityDataBase implements KimEntityEntityType { |
45 | |
|
46 | |
private static final long serialVersionUID = 1L; |
47 | |
|
48 | |
@Id |
49 | |
@Column(name = "ENTITY_ID") |
50 | |
protected String entityId; |
51 | |
|
52 | |
@Id |
53 | |
@Column(name = "ENT_TYP_CD") |
54 | |
protected String entityTypeCode; |
55 | |
|
56 | |
@ManyToOne(targetEntity = EntityTypeImpl.class, fetch = FetchType.LAZY, cascade = {}) |
57 | |
@JoinColumn(name = "ENT_TYP_CD", insertable = false, updatable = false) |
58 | |
protected EntityType entityType; |
59 | |
|
60 | 0 | @OneToMany(targetEntity = KimEntityEmailImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL }) |
61 | |
@JoinColumn(name = "ENTITY_ID", insertable = false, updatable = false) |
62 | |
protected List<KimEntityEmail> emailAddresses = new TypedArrayList(KimEntityEmailImpl.class); |
63 | |
|
64 | 0 | @OneToMany(targetEntity = KimEntityPhoneImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL }) |
65 | |
@JoinColumn(name = "ENTITY_ID", insertable = false, updatable = false) |
66 | |
protected List<KimEntityPhone> phoneNumbers = new TypedArrayList(KimEntityPhoneImpl.class); |
67 | |
|
68 | 0 | @OneToMany(targetEntity = KimEntityAddressImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL }) |
69 | |
@JoinColumn(name = "ENTITY_ID", insertable = false, updatable = false) |
70 | |
protected List<KimEntityAddress> addresses = new TypedArrayList(KimEntityAddressImpl.class); |
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
public List<KimEntityAddress> getAddresses() { |
76 | 0 | return addresses; |
77 | |
} |
78 | |
|
79 | |
|
80 | |
|
81 | |
|
82 | |
public List<KimEntityEmail> getEmailAddresses() { |
83 | 0 | return emailAddresses; |
84 | |
} |
85 | |
|
86 | |
|
87 | |
|
88 | |
|
89 | |
public List<KimEntityPhone> getPhoneNumbers() { |
90 | 0 | return phoneNumbers; |
91 | |
} |
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | |
public EntityType getEntityType() { |
97 | 0 | return entityType; |
98 | |
} |
99 | |
|
100 | |
|
101 | |
|
102 | |
|
103 | |
public String getEntityTypeCode() { |
104 | 0 | return entityTypeCode; |
105 | |
} |
106 | |
|
107 | |
|
108 | |
|
109 | |
|
110 | |
@SuppressWarnings("unchecked") |
111 | |
@Override |
112 | |
protected LinkedHashMap toStringMapper() { |
113 | 0 | LinkedHashMap m = new LinkedHashMap(); |
114 | 0 | m.put( "entityId", entityId ); |
115 | 0 | m.put( "entityTypeCode", entityTypeCode ); |
116 | 0 | m.put( "active", active ); |
117 | 0 | return m; |
118 | |
} |
119 | |
|
120 | |
public String getEntityId() { |
121 | 0 | return this.entityId; |
122 | |
} |
123 | |
|
124 | |
public void setEntityId(String entityId) { |
125 | 0 | this.entityId = entityId; |
126 | 0 | } |
127 | |
|
128 | |
public void setEntityType(EntityType entityType) { |
129 | 0 | this.entityType = entityType; |
130 | 0 | } |
131 | |
|
132 | |
public void setEntityTypeCode(String entityTypeCode) { |
133 | 0 | this.entityTypeCode = entityTypeCode; |
134 | 0 | } |
135 | |
|
136 | |
public void setEmailAddresses(List<KimEntityEmail> entityEmailAddresses) { |
137 | 0 | this.emailAddresses = entityEmailAddresses; |
138 | 0 | } |
139 | |
|
140 | |
public void setPhoneNumbers(List<KimEntityPhone> entityPhoneNumbers) { |
141 | 0 | this.phoneNumbers = entityPhoneNumbers; |
142 | 0 | } |
143 | |
|
144 | |
public void setAddresses(List<KimEntityAddress> entityAddresses) { |
145 | 0 | this.addresses = entityAddresses; |
146 | 0 | } |
147 | |
|
148 | |
|
149 | |
|
150 | |
|
151 | |
public KimEntityAddress getDefaultAddress() { |
152 | 0 | return (KimEntityAddress)getDefaultItem( addresses ); |
153 | |
} |
154 | |
|
155 | |
|
156 | |
|
157 | |
|
158 | |
|
159 | |
|
160 | |
public KimEntityEmail getDefaultEmailAddress() { |
161 | 0 | return (KimEntityEmail)getDefaultItem( emailAddresses ); |
162 | |
} |
163 | |
|
164 | |
|
165 | |
|
166 | |
|
167 | |
|
168 | |
|
169 | |
public KimEntityPhone getDefaultPhoneNumber() { |
170 | 0 | return (KimEntityPhone)getDefaultItem( phoneNumbers ); |
171 | |
} |
172 | |
} |