Coverage Report - org.kuali.rice.shareddata.impl.campus.CampusTypeBo
 
Classes in this File Line Coverage Branch Coverage Complexity
CampusTypeBo
30%
3/10
75%
3/4
0
 
 1  
 /*
 2  
  * Copyright 2006-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  
 
 17  
 package org.kuali.rice.shareddata.impl.campus
 18  
 
 19  
 import javax.persistence.Column
 20  
 import javax.persistence.Entity
 21  
 import javax.persistence.Id
 22  
 import javax.persistence.Table
 23  
 import org.hibernate.annotations.Type
 24  
 import org.kuali.rice.krad.bo.MutableInactivatable
 25  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 26  
 import org.kuali.rice.shareddata.api.campus.CampusType
 27  
 import org.kuali.rice.shareddata.api.campus.CampusTypeContract
 28  
 
 29  
 @Entity
 30  
 @Table(name="KRLC_CMP_TYP_T")
 31  
 public class CampusTypeBo extends PersistableBusinessObjectBase implements MutableInactivatable, CampusTypeContract {
 32  
         @Id
 33  
         @Column(name="CAMPUS_TYP_CD")
 34  
         def String code;
 35  
         
 36  
         @Column(name="CMP_TYP_NM")
 37  
         def String name;
 38  
         
 39  
         @Type(type="yes_no")
 40  
         @Column(name="ACTV_IND")
 41  
         def boolean active;
 42  
         
 43  
         /**
 44  
         * Converts a mutable CountryBo to an immutable Country representation.
 45  
         * @param bo
 46  
         * @return an immutable Country
 47  
         */
 48  
    static CampusType to(CampusTypeBo bo) {
 49  5
          if (bo == null) { return null }
 50  4
          return CampusType.Builder.create(bo).build()
 51  
    }
 52  
  
 53  
    /**
 54  
         * Creates a CountryBo business object from an immutable representation of a Country.
 55  
         * @param an immutable Country
 56  
         * @return a CountryBo
 57  
         */
 58  
    static CampusTypeBo from(CampusType im) {
 59  1
          if (im == null) {return null}
 60  
  
 61  0
          CampusTypeBo bo = new CampusTypeBo()
 62  0
          bo.code = im.code
 63  0
          bo.name = im.name
 64  0
          bo.active = im.active
 65  0
      bo.versionNumber = im.versionNumber
 66  0
          bo.objectId = im.objectId
 67  
  
 68  0
          return bo;
 69  
    }
 70  
 }