Coverage Report - org.kuali.rice.krms.impl.repository.PropositionParameterBo
 
Classes in this File Line Coverage Branch Coverage Complexity
PropositionParameterBo
0%
0/26
0%
0/12
0
 
 1  
 package org.kuali.rice.krms.impl.repository
 2  
 
 3  
 import javax.persistence.Column
 4  
 import javax.persistence.Entity
 5  
 import javax.persistence.FetchType
 6  
 import javax.persistence.GeneratedValue
 7  
 import javax.persistence.Id
 8  
 import javax.persistence.JoinColumn
 9  
 import javax.persistence.OneToOne
 10  
 import javax.persistence.Table
 11  
 
 12  
 import org.hibernate.annotations.Type
 13  
 import org.hibernate.annotations.GenericGenerator
 14  
 import org.hibernate.annotations.Parameter
 15  
 
 16  
 import org.kuali.rice.kns.bo.ExternalizableBusinessObject
 17  
 import org.kuali.rice.kns.bo.Inactivateable
 18  
 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase
 19  
 
 20  
 import org.kuali.rice.krms.api.repository.PropositionParameterContract
 21  
 import org.kuali.rice.krms.api.repository.PropositionParameter
 22  
 
 23  
 @Entity
 24  
 @Table(name="KRMS_PROP_PARM_T")
 25  
 public class PropositionParameterBo extends PersistableBusinessObjectBase implements PropositionParameterContract {
 26  
 
 27  
         @Id
 28  
         @GeneratedValue(generator="KRMS_PROP_PARM_S")
 29  
         @GenericGenerator(name="KRMS_PROP_PARM_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters=[
 30  
                 @Parameter(name="sequence_name",value="KRMS_PROP_PARM_S"),
 31  
                 @Parameter(name="value_column",value="id")
 32  
         ])
 33  
         @Column(name="ID")
 34  
         def String id
 35  
         
 36  
         @Column(name="PROP_ID")
 37  
         def String propId
 38  
         
 39  
         @Column(name="PARM_VAL")
 40  
         def String value
 41  
         
 42  
         @Column(name="PARM_TYP_CD")
 43  
         def String parameterType
 44  
         
 45  
         @Column(name="SEQ_NO")
 46  
         def Integer sequenceNumber
 47  
         
 48  
         
 49  
         /**
 50  
         * Converts a mutable bo to it's immutable counterpart
 51  
         * @param bo the mutable business object
 52  
         * @return the immutable object
 53  
         */
 54  
    static PropositionParameter to(PropositionParameterBo bo) {
 55  0
            if (bo == null) { return null }
 56  0
            return org.kuali.rice.krms.api.repository.PropositionParameter.Builder.create(bo).build()
 57  
    }
 58  
 
 59  
         /**
 60  
         * Converts a list of mutable bos to it's immutable counterpart
 61  
         * @param bos the list of smutable business objects
 62  
         * @return and immutable list containing the immutable objects
 63  
         */
 64  
    static List<PropositionParameter> to(List<PropositionParameterBo> bos) {
 65  0
            if (bos == null) { return null }
 66  0
            List<PropositionParameter> parms = new ArrayList<PropositionParameter>();
 67  0
            for (PropositionParameter p : bos){
 68  0
                    parms.add(PropositionParameter.Builder.create(p).build())
 69  
            }
 70  0
            return Collections.unmodifiableList(parms)
 71  
    }
 72  
    /**
 73  
         * Converts a immutable object to it's mutable bo counterpart
 74  
         * @param im immutable object
 75  
         * @return the mutable bo
 76  
         */
 77  
    static PropositionParameterBo from(PropositionParameter im) {
 78  0
            if (im == null) { return null }
 79  
 
 80  0
            PropositionParameterBo bo = new PropositionParameterBo()
 81  0
            bo.id = im.id
 82  0
            bo.propId = im.propId
 83  0
            bo.value = im.value
 84  0
            bo.parameterType = im.parameterType
 85  0
            bo.sequenceNumber = im.sequenceNumber
 86  
 
 87  0
            return bo
 88  
    }
 89  
    
 90  
    static List<PropositionParameterBo> from(List<PropositionParameter> ims){
 91  0
            if (ims == null) {return null }
 92  0
            List<PropositionParameterBo> bos = new ArrayList<PropositionParameterBo>();
 93  0
            for (PropositionParameterBo im : ims){
 94  0
                    PropositionParameterBo bo = new PropositionParameterBo()
 95  0
                    bo.id = im.id
 96  0
                    bo.propId = im.propId
 97  0
                    bo.value = im.value
 98  0
                    bo.parameterType = im.parameterType
 99  0
                    bo.sequenceNumber = im.sequenceNumber
 100  0
                       bos.add(bo);
 101  
            }
 102  0
            return Collections.unmodifiableList(bos)
 103  
    }
 104  
  
 105  
 }