1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kim.impl.identity.visa |
17 | |
|
18 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase |
19 | |
import org.kuali.rice.kim.api.identity.visa.EntityVisaContract |
20 | |
import javax.persistence.Id |
21 | |
import javax.persistence.GeneratedValue |
22 | |
import org.hibernate.annotations.GenericGenerator |
23 | |
import org.hibernate.annotations.Parameter |
24 | |
import javax.persistence.Column |
25 | |
import org.kuali.rice.kim.api.identity.visa.EntityVisa |
26 | |
import javax.persistence.Entity |
27 | |
import javax.persistence.Table |
28 | |
|
29 | |
@Entity |
30 | |
@Table(name = "KRIM_ENTITY_VISA_T") |
31 | |
class EntityVisaBo extends PersistableBusinessObjectBase implements EntityVisaContract { |
32 | |
@Id |
33 | |
@GeneratedValue(generator="KRIM_ENTITY_VISA_ID_S") |
34 | |
@GenericGenerator(name="KRIM_ENTITY_VISA_ID_S",strategy="org.kuali.rice.core.jpa.spring.RiceNumericStringSequenceStyleGenerator",parameters=[ |
35 | |
@Parameter(name="sequence_name",value="KRIM_ENTITY_VISA_ID_S"), |
36 | |
@Parameter(name="value_column",value="id") |
37 | |
]) |
38 | |
@Column(name = "ID") |
39 | |
String id; |
40 | |
|
41 | |
@Column(name = "ENTITY_ID") |
42 | |
String entityId; |
43 | |
|
44 | |
@Column(name = "VISA_TYPE_KEY") |
45 | |
String visaTypeKey; |
46 | |
|
47 | |
@Column(name = "VISA_ENTRY") |
48 | |
String visaEntry; |
49 | |
|
50 | |
@Column(name = "VISA_ID") |
51 | |
String visaId; |
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
static EntityVisa to(EntityVisaBo bo) { |
59 | 0 | if (bo == null) { return null } |
60 | 1 | return EntityVisa.Builder.create(bo).build() |
61 | |
} |
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
static EntityVisaBo from(EntityVisa immutable) { |
69 | 0 | if (immutable == null) {return null} |
70 | |
|
71 | 1 | EntityVisaBo bo = new EntityVisaBo() |
72 | 1 | bo.id = immutable.id |
73 | 1 | bo.entityId = immutable.entityId |
74 | 1 | bo.visaTypeKey = immutable.visaTypeKey |
75 | 1 | bo.visaEntry = immutable.visaEntry |
76 | 1 | bo.visaId = immutable.visaId |
77 | 1 | bo.versionNumber = immutable.versionNumber |
78 | 1 | bo.objectId = immutable.objectId |
79 | |
|
80 | 1 | return bo; |
81 | |
} |
82 | |
} |