001 /**
002 * Copyright 2005-2014 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 */
016 package org.kuali.rice.kim.bo.ui;
017
018 import javax.persistence.CascadeType;
019 import javax.persistence.Column;
020 import javax.persistence.Embeddable;
021 import javax.persistence.FetchType;
022 import javax.persistence.GeneratedValue;
023 import javax.persistence.Id;
024 import javax.persistence.JoinColumn;
025 import javax.persistence.MappedSuperclass;
026 import javax.persistence.OneToOne;
027 import javax.persistence.Transient;
028
029 import org.kuali.rice.kim.impl.common.attribute.KimAttributeBo;
030 import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
031
032 /**
033 * This class is the base class for KIM documents sub-business objects that store attribute/qualifier data
034 *
035 * @author Kuali Rice Team (rice.collab@kuali.org)
036 *
037 */
038 @MappedSuperclass
039 public class KimDocumentAttributeDataBusinessObjectBase extends KimDocumentBoActivatableEditableBase {
040
041 private static final long serialVersionUID = -1512640359333185819L;
042
043 @Id
044 @Column(name = "ATTR_DATA_ID")
045 @GeneratedValue(generator="KRIM_ATTR_DATA_ID_S")
046 @PortableSequenceGenerator(name = "KRIM_ATTR_DATA_ID_S" )
047 private String attrDataId;
048
049 @Column(name = "KIM_TYP_ID")
050 private String kimTypId;
051
052 @Column(name = "KIM_ATTR_DEFN_ID")
053 private String kimAttrDefnId;
054
055 @Column(name = "ATTR_VAL")
056 private String attrVal = "";
057
058 @OneToOne(targetEntity=KimAttributeBo.class, fetch=FetchType.EAGER, cascade={ CascadeType.REFRESH } )
059 @JoinColumn(name="KIM_ATTR_DEFN_ID",insertable=false,updatable=false)
060
061 private KimAttributeBo kimAttribute;
062
063 @Transient
064 private String qualifierKey;
065
066 @Transient
067 private Boolean unique;
068
069 public KimDocumentAttributeDataBusinessObjectBase() {
070 super();
071 }
072
073 public String getAttrDataId() {
074 return attrDataId;
075 }
076
077 public void setAttrDataId(String attrDataId) {
078 this.attrDataId = attrDataId;
079 }
080
081 public String getKimTypId() {
082 return kimTypId;
083 }
084
085 public void setKimTypId(String kimTypId) {
086 this.kimTypId = kimTypId;
087 }
088
089 public String getKimAttrDefnId() {
090 return kimAttrDefnId;
091 }
092
093 public void setKimAttrDefnId(String kimAttrDefnId) {
094 this.kimAttrDefnId = kimAttrDefnId;
095 }
096
097 public String getAttrVal() {
098 return attrVal;
099 }
100
101 public void setAttrVal(String attrVal) {
102 this.attrVal = attrVal;
103 }
104
105 public String getQualifierKey() {
106 return this.qualifierKey;
107 }
108
109 public void setQualifierKey(String qualifierKey) {
110 this.qualifierKey = qualifierKey;
111 }
112
113 /**
114 * @return the kimAttribute
115 */
116 public KimAttributeBo getKimAttribute() {
117 return this.kimAttribute;
118 }
119
120 /**
121 * @param kimAttribute the kimAttribute to set
122 */
123 public void setKimAttribute(KimAttributeBo kimAttribute) {
124 this.kimAttribute = kimAttribute;
125 }
126
127 /**
128 * @return the uniqueAndReadOnly
129 */
130 public Boolean isUnique() {
131 return this.unique;
132 }
133
134 /**
135 * @param uniqueAndReadOnly the uniqueAndReadOnly to set
136 */
137 public void setUnique(Boolean unique) {
138 this.unique = unique;
139 }
140
141 }