Coverage Report - org.kuali.rice.kew.rule.RuleTemplateOption
 
Classes in this File Line Coverage Branch Coverage Complexity
RuleTemplateOption
0%
0/25
N/A
1
 
 1  
 /*
 2  
  * Copyright 2005-2008 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.kew.rule;
 18  
 
 19  
 import org.hibernate.annotations.GenericGenerator;
 20  
 import org.hibernate.annotations.Parameter;
 21  
 import org.kuali.rice.core.framework.persistence.jpa.OrmUtils;
 22  
 import org.kuali.rice.kew.rule.bo.RuleTemplate;
 23  
 import org.kuali.rice.kew.service.KEWServiceLocator;
 24  
 
 25  
 import javax.persistence.*;
 26  
 import java.io.Serializable;
 27  
 
 28  
 
 29  
 /**
 30  
  * Defines default values and other preset information for a {@link RuleBaseValues} 
 31  
  * which is based off of the associated {@link RuleTemplate}.
 32  
  * 
 33  
  * @see RuleBaseValues
 34  
  * @see RuleTemplate
 35  
  *
 36  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 37  
  */
 38  
 @Entity
 39  
 @Table(name="KREW_RULE_TMPL_OPTN_T")
 40  
 //@Sequence(name="KREW_RULE_TMPL_OPTN_S", property="ruleTemplateOptionId")
 41  
 public class RuleTemplateOption implements Serializable {
 42  
 
 43  
         private static final long serialVersionUID = 8913119135197149224L;
 44  
         @Id
 45  
         @GeneratedValue(generator="KREW_RULE_TMPL_OPTN_S")
 46  
         @GenericGenerator(name="KREW_RULE_TMPL_OPTN_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters={
 47  
                         @Parameter(name="sequence_name",value="KREW_RULE_TMPL_OPTN_S"),
 48  
                         @Parameter(name="value_column",value="id")
 49  
         })
 50  
         @Column(name="RULE_TMPL_OPTN_ID")
 51  
         private Long ruleTemplateOptionId;
 52  
     @Column(name="RULE_TMPL_ID", insertable=false, updatable=false)
 53  
         private Long ruleTemplateId;
 54  
     @Column(name="KEY_CD")
 55  
         private String key;
 56  
     @Column(name="VAL")
 57  
         private String value;
 58  
     @Version
 59  
         @Column(name="VER_NBR")
 60  
         private Integer lockVerNbr;
 61  
 
 62  
     @ManyToOne(fetch=FetchType.EAGER)
 63  
         @JoinColumn(name="RULE_TMPL_ID")
 64  
         private RuleTemplate ruleTemplate;
 65  
     
 66  0
     public RuleTemplateOption(){}
 67  
     
 68  0
     public RuleTemplateOption(String key, String value){
 69  0
         this.key = key;
 70  0
         this.value = value;
 71  0
     }
 72  
 
 73  
     //@PrePersist
 74  
     public void beforeInsert(){
 75  0
         OrmUtils.populateAutoIncValue(this, KEWServiceLocator.getEntityManagerFactory().createEntityManager());
 76  0
     }
 77  
 
 78  
     public String getKey() {
 79  0
         return key;
 80  
     }
 81  
 
 82  
     public void setKey(String key) {
 83  0
         this.key = key;
 84  0
     }
 85  
 
 86  
     public Integer getLockVerNbr() {
 87  0
         return lockVerNbr;
 88  
     }
 89  
 
 90  
     public void setLockVerNbr(Integer lockVerNbr) {
 91  0
         this.lockVerNbr = lockVerNbr;
 92  0
     }
 93  
 
 94  
     public RuleTemplate getRuleTemplate() {
 95  0
         return ruleTemplate;
 96  
     }
 97  
 
 98  
     public void setRuleTemplate(RuleTemplate ruleTemplate) {
 99  0
         this.ruleTemplate = ruleTemplate;
 100  0
     }
 101  
 
 102  
     public Long getRuleTemplateId() {
 103  0
         return ruleTemplateId;
 104  
     }
 105  
 
 106  
     public void setRuleTemplateId(Long ruleTemplateId) {
 107  0
         this.ruleTemplateId = ruleTemplateId;
 108  0
     }
 109  
 
 110  
     public Long getRuleTemplateOptionId() {
 111  0
         return ruleTemplateOptionId;
 112  
     }
 113  
 
 114  
     public void setRuleTemplateOptionId(Long ruleTemplateOptionId) {
 115  0
         this.ruleTemplateOptionId = ruleTemplateOptionId;
 116  0
     }
 117  
 
 118  
     public String getValue() {
 119  0
         return value;
 120  
     }
 121  
 
 122  
     public void setValue(String value) {
 123  0
         this.value = value;
 124  0
     }
 125  
 }
 126