Coverage Report - org.kuali.student.r2.core.class1.enumerationmanagement.model.EnumContextValueEntity
 
Classes in this File Line Coverage Branch Coverage Complexity
EnumContextValueEntity
0%
0/20
N/A
1
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 14  
  */
 15  
 
 16  
 package org.kuali.student.r2.core.class1.enumerationmanagement.model;
 17  
 
 18  
 import java.util.List;
 19  
 
 20  
 import javax.persistence.CascadeType;
 21  
 import javax.persistence.Column;
 22  
 import javax.persistence.Entity;
 23  
 import javax.persistence.FetchType;
 24  
 import javax.persistence.ManyToMany;
 25  
 import javax.persistence.Table;
 26  
 import javax.persistence.UniqueConstraint;
 27  
 
 28  
 import org.kuali.student.r2.common.entity.MetaEntity;
 29  
 import org.kuali.student.r2.core.enumerationmanagement.dto.EnumContextValueInfo;
 30  
 import org.kuali.student.r2.core.enumerationmanagement.infc.EnumContextValue;
 31  
 
 32  
 @Entity
 33  
 @Table(name="KSEN_CTX_T", uniqueConstraints={@UniqueConstraint(columnNames={"CTX_KEY", "CTX_VAL"})})
 34  
 public class EnumContextValueEntity extends MetaEntity {
 35  
 
 36  
     @Column(name="CTX_KEY")
 37  
     String contextKey;
 38  
     
 39  
     @Column(name="CTX_VAL")
 40  
     String contextValue;
 41  
 
 42  
     @ManyToMany(mappedBy="contextValueEntities", fetch = FetchType.LAZY,cascade = CascadeType.ALL)
 43  
     List<EnumeratedValueEntity> enumeratedValueList;
 44  
     
 45  0
     public EnumContextValueEntity() {
 46  0
     }
 47  
 
 48  
     public EnumContextValueEntity(EnumContextValue enumContextValue) {
 49  0
         super(enumContextValue);
 50  0
         this.setContextKey(enumContextValue.getKey());
 51  0
         this.setContextValue(enumContextValue.getValue());
 52  0
     }
 53  
     
 54  
     public String getContextKey() {
 55  0
         return contextKey;
 56  
     }
 57  
 
 58  
     public void setContextKey(String type) {
 59  0
         this.contextKey = type;
 60  0
     }
 61  
 
 62  
     public String getContextValue() {
 63  0
         return contextValue;
 64  
     }
 65  
 
 66  
     public void setContextValue(String value) {
 67  0
         this.contextValue = value;
 68  0
     }
 69  
     
 70  
         public List<EnumeratedValueEntity> getEnumeratedValueList() {
 71  0
                 return enumeratedValueList;
 72  
         }
 73  
         public void setEnumeratedValueList(
 74  
                         List<EnumeratedValueEntity> enumeratedValueList) {
 75  0
                 this.enumeratedValueList = enumeratedValueList;
 76  0
         }
 77  
 
 78  
     public EnumContextValueInfo toDto() {
 79  0
         EnumContextValueInfo context = new EnumContextValueInfo();
 80  0
         context.setMeta(super.toDTO());
 81  0
         context.setKey(this.getContextKey());
 82  0
         context.setValue(this.getContextValue());
 83  0
         return context;
 84  
     }
 85  
     
 86  
 }