Coverage Report - org.kuali.rice.location.impl.campus.CampusTypeBo
 
Classes in this File Line Coverage Branch Coverage Complexity
CampusTypeBo
0%
0/10
0%
0/8
0
 
 1  
 /**
 2  
  * Copyright 2005-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.location.impl.campus
 17  
 
 18  
 import javax.persistence.Column
 19  
 import javax.persistence.Entity
 20  
 import javax.persistence.Id
 21  
 import javax.persistence.Table
 22  
 import org.hibernate.annotations.Type
 23  
 import org.kuali.rice.core.api.mo.common.active.MutableInactivatable
 24  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 25  
 import org.kuali.rice.location.api.campus.CampusType
 26  
 import org.kuali.rice.location.api.campus.CampusTypeContract
 27  
 
 28  
 @Entity
 29  
 @Table(name="KRLC_CMP_TYP_T")
 30  
 public class CampusTypeBo extends PersistableBusinessObjectBase implements MutableInactivatable, CampusTypeContract {
 31  
         @Id
 32  
         @Column(name="CAMPUS_TYP_CD")
 33  
         def String code;
 34  
         
 35  
         @Column(name="CMP_TYP_NM")
 36  
         def String name;
 37  
         
 38  
         @Type(type="yes_no")
 39  
         @Column(name="ACTV_IND")
 40  
         def boolean active;
 41  
         
 42  
         /**
 43  
         * Converts a mutable CountryBo to an immutable Country representation.
 44  
         * @param bo
 45  
         * @return an immutable Country
 46  
         */
 47  
    static CampusType to(CampusTypeBo bo) {
 48  0
          if (bo == null) { return null }
 49  0
          return CampusType.Builder.create(bo).build()
 50  
    }
 51  
  
 52  
    /**
 53  
         * Creates a CountryBo business object from an immutable representation of a Country.
 54  
         * @param an immutable Country
 55  
         * @return a CountryBo
 56  
         */
 57  
    static CampusTypeBo from(CampusType im) {
 58  0
          if (im == null) {return null}
 59  
  
 60  0
          CampusTypeBo bo = new CampusTypeBo()
 61  0
          bo.code = im.code
 62  0
          bo.name = im.name
 63  0
          bo.active = im.active
 64  0
      bo.versionNumber = im.versionNumber
 65  0
          bo.objectId = im.objectId
 66  
  
 67  0
          return bo;
 68  
    }
 69  
 }