View Javadoc
1   /**
2    * Copyright 2005-2016 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.eclipse.persistence.annotations.JoinFetch;
30  import org.eclipse.persistence.annotations.JoinFetchType;
31  import org.kuali.rice.kim.impl.common.attribute.KimAttributeBo;
32  import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
33  
34  /**
35   * This class is the base class for KIM documents sub-business objects that store attribute/qualifier data
36   * 
37   * @author Kuali Rice Team (rice.collab@kuali.org)
38   *
39   */
40  @MappedSuperclass
41  public class KimDocumentAttributeDataBusinessObjectBase extends KimDocumentBoActivatableEditableBase {
42  
43      private static final long serialVersionUID = -1512640359333185819L;
44  
45  	@Id
46  	@Column(name = "ATTR_DATA_ID")
47      @GeneratedValue(generator="KRIM_ATTR_DATA_ID_S")
48      @PortableSequenceGenerator(name = "KRIM_ATTR_DATA_ID_S" )
49  	private String attrDataId;
50  
51  	@Column(name = "KIM_TYP_ID")
52  	private String kimTypId;
53  	
54  	@Column(name = "KIM_ATTR_DEFN_ID")
55  	private String kimAttrDefnId;
56  	
57  	@Column(name = "ATTR_VAL")
58  	private String attrVal = "";
59  
60  	@JoinFetch(value= JoinFetchType.OUTER)
61  	@OneToOne(targetEntity=KimAttributeBo.class, fetch=FetchType.EAGER, cascade={ CascadeType.REFRESH } )
62      @JoinColumn(name="KIM_ATTR_DEFN_ID",insertable=false,updatable=false)
63  	private KimAttributeBo kimAttribute;
64  	
65  	@Transient
66  	private String qualifierKey;
67  	
68  	@Transient
69  	private Boolean unique;
70  	
71  	public KimDocumentAttributeDataBusinessObjectBase() {
72  		super();
73  	}
74  
75  	public String getAttrDataId() {
76  		return attrDataId;
77  	}
78  
79  	public void setAttrDataId(String attrDataId) {
80  		this.attrDataId = attrDataId;
81  	}
82  
83  	public String getKimTypId() {
84  		return kimTypId;
85  	}
86  
87  	public void setKimTypId(String kimTypId) {
88  		this.kimTypId = kimTypId;
89  	}
90  
91  	public String getKimAttrDefnId() {
92  		return kimAttrDefnId;
93  	}
94  
95  	public void setKimAttrDefnId(String kimAttrDefnId) {
96  		this.kimAttrDefnId = kimAttrDefnId;
97  	}
98  
99  	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 }