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