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