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