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  
 
 24  
 import org.hibernate.annotations.Type
 25  
 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase
 26  
 import org.kuali.rice.shareddata.api.campus.CampusType
 27  
 import org.kuali.rice.shareddata.api.campus.CampusTypeContract
 28  
 import org.kuali.rice.kns.bo.ExternalizableBusinessObject;
 29  
 import org.kuali.rice.kns.bo.Inactivateable;
 30  
 import org.kuali.rice.shareddata.api.campus.CampusContract;
 31  
 
 32  
 @Entity
 33  
 @Table(name="KRNS_CMP_TYP_T")
 34  
 public class CampusTypeBo extends PersistableBusinessObjectBase implements Inactivateable, CampusTypeContract {
 35  
         @Id
 36  
         @Column(name="CAMPUS_TYP_CD")
 37  
         def String code;
 38  
         
 39  
         @Column(name="CMP_TYP_NM")
 40  
         def String name;
 41  
         
 42  
         @Type(type="yes_no")
 43  
         @Column(name="ACTV_IND")
 44  
         def boolean active;
 45  
         
 46  
         /**
 47  
         * Converts a mutable CountryBo to an immutable Country representation.
 48  
         * @param bo
 49  
         * @return an immutable Country
 50  
         */
 51  
    static CampusType to(CampusTypeBo bo) {
 52  5
          if (bo == null) { return null }
 53  4
          return CampusType.Builder.create(bo).build()
 54  
    }
 55  
  
 56  
    /**
 57  
         * Creates a CountryBo business object from an immutable representation of a Country.
 58  
         * @param an immutable Country
 59  
         * @return a CountryBo
 60  
         */
 61  
    static CampusTypeBo from(CampusType im) {
 62  1
          if (im == null) {return null}
 63  
  
 64  0
          CampusTypeBo bo = new CampusTypeBo()
 65  0
          bo.code = im.code
 66  0
          bo.name = im.name
 67  0
          bo.active = im.active
 68  0
      bo.versionNumber = im.versionNumber
 69  0
          bo.objectId = im.objectId
 70  
  
 71  0
          return bo;
 72  
    }
 73  
 }