View Javadoc
1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kim.bo.ui;
17  
18  import javax.persistence.CascadeType;
19  import javax.persistence.Column;
20  import javax.persistence.Embeddable;
21  import javax.persistence.FetchType;
22  import javax.persistence.GeneratedValue;
23  import javax.persistence.Id;
24  import javax.persistence.JoinColumn;
25  import javax.persistence.MappedSuperclass;
26  import javax.persistence.OneToOne;
27  import javax.persistence.Transient;
28  
29  import org.kuali.rice.kim.impl.common.attribute.KimAttributeBo;
30  import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
31  
32  /**
33   * This class is the base class for KIM documents sub-business objects that store attribute/qualifier data
34   * 
35   * @author Kuali Rice Team (rice.collab@kuali.org)
36   *
37   */
38  @MappedSuperclass
39  public class KimDocumentAttributeDataBusinessObjectBase extends KimDocumentBoActivatableEditableBase {
40  
41      private static final long serialVersionUID = -1512640359333185819L;
42  
43  	@Id
44  	@Column(name = "ATTR_DATA_ID")
45      @GeneratedValue(generator="KRIM_ATTR_DATA_ID_S")
46      @PortableSequenceGenerator(name = "KRIM_ATTR_DATA_ID_S" )
47  	private String attrDataId;
48  
49  	@Column(name = "KIM_TYP_ID")
50  	private String kimTypId;
51  	
52  	@Column(name = "KIM_ATTR_DEFN_ID")
53  	private String kimAttrDefnId;
54  	
55  	@Column(name = "ATTR_VAL")
56  	private String attrVal = "";
57  	
58  	@OneToOne(targetEntity=KimAttributeBo.class, fetch=FetchType.EAGER, cascade={ CascadeType.REFRESH } )
59      @JoinColumn(name="KIM_ATTR_DEFN_ID",insertable=false,updatable=false)
60  	
61  	private KimAttributeBo kimAttribute;
62  	
63  	@Transient
64  	private String qualifierKey;
65  	
66  	@Transient
67  	private Boolean unique;
68  	
69  	public KimDocumentAttributeDataBusinessObjectBase() {
70  		super();
71  	}
72  
73  	public String getAttrDataId() {
74  		return attrDataId;
75  	}
76  
77  	public void setAttrDataId(String attrDataId) {
78  		this.attrDataId = attrDataId;
79  	}
80  
81  	public String getKimTypId() {
82  		return kimTypId;
83  	}
84  
85  	public void setKimTypId(String kimTypId) {
86  		this.kimTypId = kimTypId;
87  	}
88  
89  	public String getKimAttrDefnId() {
90  		return kimAttrDefnId;
91  	}
92  
93  	public void setKimAttrDefnId(String kimAttrDefnId) {
94  		this.kimAttrDefnId = kimAttrDefnId;
95  	}
96  
97  	public String getAttrVal() {
98  		return attrVal;
99  	}
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 }