Coverage Report - org.kuali.rice.core.impl.namespace.NamespaceBo
 
Classes in this File Line Coverage Branch Coverage Complexity
NamespaceBo
0%
0/13
0%
0/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  
 package org.kuali.rice.core.impl.namespace;
 17  
 
 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.core.api.namespace.Namespace
 25  
 import org.kuali.rice.core.api.namespace.NamespaceContract
 26  
 import org.kuali.rice.krad.bo.Inactivatable
 27  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 28  
 
 29  
 @Entity
 30  
 @Table(name="KRCR_NMSPC_T")
 31  
 class NamespaceBo extends PersistableBusinessObjectBase implements NamespaceContract, Inactivatable {
 32  
 
 33  
     private static final long serialVersionUID = 1L;
 34  
 
 35  
     @Column(name="APPL_ID")
 36  
         def String applicationId;
 37  
 
 38  
     @Id
 39  
     @Column(name="NMSPC_CD")
 40  
     def String code;
 41  
 
 42  
     @Column(name="NM")
 43  
     def String name;
 44  
 
 45  
     @Type(type="yes_no")
 46  
     @Column(name="ACTV_IND")
 47  
     def boolean active;
 48  
 
 49  
     /**
 50  
      * Converts a mutable bo to its immutable counterpart
 51  
      * @param bo the mutable business object
 52  
      * @return the immutable object
 53  
      */
 54  
     static Namespace to(NamespaceBo bo) {
 55  0
         if (bo == null) {
 56  0
             return null
 57  
         }
 58  
 
 59  0
         return Namespace.Builder.create(bo).build();
 60  
     }
 61  
 
 62  
     /**
 63  
      * Converts a immutable object to its mutable counterpart
 64  
      * @param im immutable object
 65  
      * @return the mutable bo
 66  
      */
 67  
     static NamespaceBo from(Namespace im) {
 68  0
         if (im == null) {
 69  0
             return null
 70  
         }
 71  
 
 72  0
         NamespaceBo bo = new NamespaceBo()
 73  0
         bo.applicationId = im.applicationId
 74  0
         bo.active = im.active
 75  0
         bo.code = im.code
 76  0
         bo.name = im.name
 77  0
         bo.versionNumber = im.versionNumber
 78  0
                 bo.objectId = im.objectId
 79  
 
 80  0
         return bo
 81  
     }
 82  
 }
 83