| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
|
| 20 | |
package org.kuali.rice.location.impl.country |
| 21 | |
|
| 22 | |
import javax.persistence.Column |
| 23 | |
import javax.persistence.Entity |
| 24 | |
import javax.persistence.Id |
| 25 | |
import javax.persistence.Table |
| 26 | |
import org.hibernate.annotations.Type |
| 27 | |
import org.kuali.rice.krad.bo.ExternalizableBusinessObject |
| 28 | |
import org.kuali.rice.core.api.mo.common.active.MutableInactivatable |
| 29 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase |
| 30 | |
import org.kuali.rice.location.api.country.Country |
| 31 | |
import org.kuali.rice.location.api.country.CountryContract |
| 32 | |
|
| 33 | |
@Entity |
| 34 | |
@Table(name="KRLC_CNTRY_T") |
| 35 | |
class CountryBo extends PersistableBusinessObjectBase implements MutableInactivatable, CountryContract, ExternalizableBusinessObject { |
| 36 | |
|
| 37 | |
@Id |
| 38 | |
@Column(name = "POSTAL_CNTRY_CD") |
| 39 | |
def String code; |
| 40 | |
|
| 41 | |
@Column(name = "ALT_POSTAL_CNTRY_CD") |
| 42 | |
def String alternateCode; |
| 43 | |
|
| 44 | |
@Column(name = "POSTAL_CNTRY_NM") |
| 45 | |
def String name; |
| 46 | |
|
| 47 | |
@Type(type = "yes_no") |
| 48 | |
@Column(name = "PSTL_CNTRY_RSTRC_IND") |
| 49 | |
def boolean restricted; |
| 50 | |
|
| 51 | |
@Type(type = "yes_no") |
| 52 | |
@Column(name = "ACTV_IND") |
| 53 | |
def boolean active; |
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
|
| 58 | |
|
| 59 | |
|
| 60 | |
static Country to(CountryBo bo) { |
| 61 | 0 | if (bo == null) { return null } |
| 62 | 0 | return Country.Builder.create(bo).build() |
| 63 | |
} |
| 64 | |
|
| 65 | |
|
| 66 | |
|
| 67 | |
|
| 68 | |
|
| 69 | |
|
| 70 | |
static CountryBo from(Country immutable) { |
| 71 | 0 | if (immutable == null) {return null} |
| 72 | |
|
| 73 | 0 | CountryBo bo = new CountryBo() |
| 74 | 0 | bo.code = immutable.code |
| 75 | 0 | bo.alternateCode = immutable.alternateCode |
| 76 | 0 | bo.name = immutable.name |
| 77 | 0 | bo.restricted = immutable.restricted |
| 78 | 0 | bo.active = immutable.active |
| 79 | 0 | bo.versionNumber = immutable.versionNumber |
| 80 | |
|
| 81 | 0 | return bo; |
| 82 | |
} |
| 83 | |
} |