Coverage Report - org.kuali.rice.ksb.impl.registry.ServiceDescriptorBo
 
Classes in this File Line Coverage Branch Coverage Complexity
ServiceDescriptorBo
0%
0/10
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.ksb.impl.registry;
 17  
 
 18  
 import javax.persistence.Column
 19  
 import javax.persistence.Entity
 20  
 import javax.persistence.GeneratedValue
 21  
 import javax.persistence.Id
 22  
 import javax.persistence.Lob
 23  
 import javax.persistence.Table
 24  
 import javax.persistence.Version
 25  
 
 26  
 import org.hibernate.annotations.GenericGenerator
 27  
 import org.hibernate.annotations.Parameter
 28  
 import org.kuali.rice.core.api.mo.ModelObjectBasic
 29  
 import org.kuali.rice.ksb.api.registry.ServiceDescriptor
 30  
 import org.kuali.rice.ksb.api.registry.ServiceDescriptorContract
 31  
 
 32  
 /**
 33  
  * TODO... 
 34  
  * 
 35  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 36  
  *
 37  
  */
 38  
 @Entity
 39  
 @Table(name="KRSB_SVC_DSCRPTR_T")
 40  
 public class ServiceDescriptorBo implements ServiceDescriptorContract, ModelObjectBasic {
 41  
 
 42  
         @Id
 43  
         @GeneratedValue(generator="KRSB_SVC_DSCRPTR_S")
 44  
         @GenericGenerator(name="KRSB_FLT_SVC_DEF_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters=[
 45  
                         @Parameter(name="sequence_name", value="KRSB_SVC_DSCRPTR_S"),
 46  
                         @Parameter(name="value_column", value="id")
 47  
         ])
 48  
         @Column(name="SVC_DSCRPTR_ID")
 49  
         String id
 50  
         
 51  
         @Lob
 52  
         @Column(name="DSCRPTR", length=4000)
 53  
         String descriptor
 54  
         
 55  
         @Version
 56  
         @Column(name="VER_NBR")
 57  
         Long versionNumber
 58  
         
 59  
         static ServiceDescriptor to(ServiceDescriptorBo bo) {
 60  0
                 if (bo == null) {
 61  0
                         return null
 62  
                 }
 63  0
                 return ServiceDescriptor.Builder.create(bo).build();
 64  
         }
 65  
         
 66  
         static ServiceDescriptorBo from(ServiceDescriptor im) {
 67  0
                 if (im == null) {
 68  0
                         return null
 69  
                 }
 70  
 
 71  0
                 ServiceDescriptorBo bo = new ServiceDescriptorBo()
 72  0
                 bo.id = im.id
 73  0
                 bo.descriptor = im.descriptor
 74  0
                 bo.versionNumber = im.versionNumber
 75  
 
 76  0
                 return bo
 77  
         }
 78  
 
 79  
 }