Coverage Report - org.kuali.rice.ksb.messaging.bam.BAMParam
 
Classes in this File Line Coverage Branch Coverage Complexity
BAMParam
0%
0/14
0%
0/2
1.143
 
 1  
 /*
 2  
  * Copyright 2005-2007 The Kuali Foundation
 3  
  * 
 4  
  * 
 5  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  * 
 9  
  * http://www.opensource.org/licenses/ecl2.php
 10  
  * 
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.kuali.rice.ksb.messaging.bam;
 18  
 
 19  
 import javax.persistence.CascadeType;
 20  
 import javax.persistence.Column;
 21  
 import javax.persistence.Entity;
 22  
 import javax.persistence.FetchType;
 23  
 import javax.persistence.Id;
 24  
 import javax.persistence.JoinColumn;
 25  
 import javax.persistence.ManyToOne;
 26  
 import javax.persistence.PrePersist;
 27  
 import javax.persistence.Table;
 28  
 
 29  
 import org.apache.commons.lang.StringUtils;
 30  
 import org.kuali.rice.core.jpa.annotations.Sequence;
 31  
 import org.kuali.rice.core.util.OrmUtils;
 32  
 import org.kuali.rice.ksb.service.KSBServiceLocator;
 33  
 
 34  
 /**
 35  
  * A parameter of a method invocation recorded by the BAM.
 36  
  *
 37  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 38  
  */
 39  
 @Entity
 40  
 @Table(name="KRSB_BAM_PARM_T")
 41  
 @Sequence(name="KRSB_BAM_PARM_S", property="bamParamId")
 42  0
 public class BAMParam {
 43  
 
 44  
         @Id
 45  
         @Column(name="BAM_PARM_ID")
 46  
         private Long bamParamId;
 47  
         @ManyToOne(fetch=FetchType.EAGER, cascade={CascadeType.PERSIST})
 48  
         @JoinColumn(name="BAM_ID")
 49  
         private BAMTargetEntry bamTargetEntry;
 50  
         @Column(name="PARM")
 51  
         private String param;
 52  
         
 53  
         @PrePersist
 54  
     public void beforeInsert(){
 55  0
             OrmUtils.populateAutoIncValue(this, KSBServiceLocator.getRegistryEntityManagerFactory().createEntityManager());
 56  0
     }
 57  
         
 58  
         public BAMTargetEntry getBamTargetEntry() {
 59  0
                 return this.bamTargetEntry;
 60  
         }
 61  
         public void setBamTargetEntry(BAMTargetEntry bamTargetEntry) {
 62  0
                 this.bamTargetEntry = bamTargetEntry;
 63  0
         }
 64  
         public Long getBamParamId() {
 65  0
                 return this.bamParamId;
 66  
         }
 67  
         public void setBamParamId(Long bamParamId) {
 68  0
                 this.bamParamId = bamParamId;
 69  0
         }
 70  
         public String getParam() {
 71  0
                 return this.param;
 72  
         }
 73  
         public void setParam(String paramToString) {
 74  0
                 if (StringUtils.isEmpty(paramToString)) {
 75  0
                         paramToString = "<null>";//oracle blows null constraint on empty strings
 76  
                 }
 77  0
                 this.param = paramToString;
 78  0
         }
 79  
 }