| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kim.impl.identity.residency |
| 17 | |
|
| 18 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase |
| 19 | |
import org.kuali.rice.kim.api.identity.residency.EntityResidencyContract |
| 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.residency.EntityResidency |
| 26 | |
|
| 27 | |
class EntityResidencyBo extends PersistableBusinessObjectBase implements EntityResidencyContract { |
| 28 | |
private static final long serialVersionUID = 6577601907062646926L; |
| 29 | |
|
| 30 | |
@Id |
| 31 | |
@GeneratedValue(generator="KRIM_ENTITY_RESIDENCY_ID_S") |
| 32 | |
@GenericGenerator(name="KRIM_ENTITY_RESIDENCY_ID_S",strategy="org.kuali.rice.core.jpa.spring.RiceNumericStringSequenceStyleGenerator",parameters=[ |
| 33 | |
@Parameter(name="sequence_name",value="KRIM_ENTITY_RESIDENCY_ID_S"), |
| 34 | |
@Parameter(name="value_column",value="id") |
| 35 | |
]) |
| 36 | |
@Column(name = "ID") |
| 37 | |
String id; |
| 38 | |
|
| 39 | |
@Column(name = "ENTITY_ID") |
| 40 | |
String entityId; |
| 41 | |
|
| 42 | |
@Column(name = "DETERMINATION_METHOD") |
| 43 | |
String determinationMethod; |
| 44 | |
|
| 45 | |
@Column(name = "IN_STATE") |
| 46 | |
String inState; |
| 47 | |
|
| 48 | |
|
| 49 | |
|
| 50 | |
|
| 51 | |
|
| 52 | |
|
| 53 | |
static EntityResidency to(EntityResidencyBo bo) { |
| 54 | 0 | if (bo == null) { return null } |
| 55 | 0 | return EntityResidency.Builder.create(bo).build() |
| 56 | |
} |
| 57 | |
|
| 58 | |
|
| 59 | |
|
| 60 | |
|
| 61 | |
|
| 62 | |
|
| 63 | |
static EntityResidencyBo from(EntityResidency immutable) { |
| 64 | 0 | if (immutable == null) {return null} |
| 65 | |
|
| 66 | 0 | EntityResidencyBo bo = new EntityResidencyBo() |
| 67 | 0 | bo.entityId = immutable.entityId |
| 68 | 0 | bo.id = immutable.id |
| 69 | 0 | bo.determinationMethod = immutable.determinationMethod |
| 70 | 0 | bo.inState = immutable.inState |
| 71 | 0 | bo.versionNumber = immutable.versionNumber |
| 72 | 0 | bo.objectId = immutable.objectId |
| 73 | |
|
| 74 | 0 | return bo; |
| 75 | |
} |
| 76 | |
} |