001/** 002 * Copyright 2005-2017 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.kim.bo.ui; 017 018import javax.persistence.CascadeType; 019import javax.persistence.Column; 020import javax.persistence.Embeddable; 021import javax.persistence.FetchType; 022import javax.persistence.GeneratedValue; 023import javax.persistence.Id; 024import javax.persistence.JoinColumn; 025import javax.persistence.MappedSuperclass; 026import javax.persistence.OneToOne; 027import javax.persistence.Transient; 028 029import org.eclipse.persistence.annotations.JoinFetch; 030import org.eclipse.persistence.annotations.JoinFetchType; 031import org.kuali.rice.kim.impl.common.attribute.KimAttributeBo; 032import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator; 033 034/** 035 * This class is the base class for KIM documents sub-business objects that store attribute/qualifier data 036 * 037 * @author Kuali Rice Team (rice.collab@kuali.org) 038 * 039 */ 040@MappedSuperclass 041public class KimDocumentAttributeDataBusinessObjectBase extends KimDocumentBoActivatableEditableBase { 042 043 private static final long serialVersionUID = -1512640359333185819L; 044 045 @Id 046 @Column(name = "ATTR_DATA_ID") 047 @GeneratedValue(generator="KRIM_ATTR_DATA_ID_S") 048 @PortableSequenceGenerator(name = "KRIM_ATTR_DATA_ID_S" ) 049 private String attrDataId; 050 051 @Column(name = "KIM_TYP_ID") 052 private String kimTypId; 053 054 @Column(name = "KIM_ATTR_DEFN_ID") 055 private String kimAttrDefnId; 056 057 @Column(name = "ATTR_VAL") 058 private String attrVal = ""; 059 060 @JoinFetch(value= JoinFetchType.OUTER) 061 @OneToOne(targetEntity=KimAttributeBo.class, fetch=FetchType.EAGER, cascade={ CascadeType.REFRESH } ) 062 @JoinColumn(name="KIM_ATTR_DEFN_ID",insertable=false,updatable=false) 063 private KimAttributeBo kimAttribute; 064 065 @Transient 066 private String qualifierKey; 067 068 @Transient 069 private Boolean unique; 070 071 public KimDocumentAttributeDataBusinessObjectBase() { 072 super(); 073 } 074 075 public String getAttrDataId() { 076 return attrDataId; 077 } 078 079 public void setAttrDataId(String attrDataId) { 080 this.attrDataId = attrDataId; 081 } 082 083 public String getKimTypId() { 084 return kimTypId; 085 } 086 087 public void setKimTypId(String kimTypId) { 088 this.kimTypId = kimTypId; 089 } 090 091 public String getKimAttrDefnId() { 092 return kimAttrDefnId; 093 } 094 095 public void setKimAttrDefnId(String kimAttrDefnId) { 096 this.kimAttrDefnId = kimAttrDefnId; 097 } 098 099 public String getAttrVal() { 100 return attrVal; 101 } 102 103 public void setAttrVal(String attrVal) { 104 this.attrVal = attrVal; 105 } 106 107 public String getQualifierKey() { 108 return this.qualifierKey; 109 } 110 111 public void setQualifierKey(String qualifierKey) { 112 this.qualifierKey = qualifierKey; 113 } 114 115 /** 116 * @return the kimAttribute 117 */ 118 public KimAttributeBo getKimAttribute() { 119 return this.kimAttribute; 120 } 121 122 /** 123 * @param kimAttribute the kimAttribute to set 124 */ 125 public void setKimAttribute(KimAttributeBo kimAttribute) { 126 this.kimAttribute = kimAttribute; 127 } 128 129 /** 130 * @return the uniqueAndReadOnly 131 */ 132 public Boolean isUnique() { 133 return this.unique; 134 } 135 136 /** 137 * @param uniqueAndReadOnly the uniqueAndReadOnly to set 138 */ 139 public void setUnique(Boolean unique) { 140 this.unique = unique; 141 } 142 143}