View Javadoc

1   /*
2    * Copyright 2007-2008 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.kns.bo;
17  
18  import java.util.LinkedHashMap;
19  
20  import javax.persistence.CascadeType;
21  import javax.persistence.Column;
22  import javax.persistence.Entity;
23  import javax.persistence.FetchType;
24  import javax.persistence.Id;
25  import javax.persistence.JoinColumn;
26  import javax.persistence.OneToOne;
27  import javax.persistence.Table;
28  
29  import org.hibernate.annotations.Type;
30  import org.kuali.rice.kns.util.KNSPropertyConstants;
31  
32  /**
33   * 
34   */
35  @Entity
36  @Table(name="KRNS_CAMPUS_T")
37  public class CampusImpl extends PersistableBusinessObjectBase implements Campus, Inactivateable {
38  
39      private static final long serialVersionUID = 787567094298971223L;
40      @Id
41  	@Column(name="CAMPUS_CD")
42  	private String campusCode;
43      @Column(name="CAMPUS_NM")
44  	private String campusName;
45      @Column(name="CAMPUS_SHRT_NM")
46  	private String campusShortName;
47      @Column(name="CAMPUS_TYP_CD")
48  	private String campusTypeCode;
49  	@Type(type="yes_no")
50  	@Column(name="ACTV_IND")
51      protected boolean active;
52  
53      @OneToOne(fetch=FetchType.EAGER, cascade={CascadeType.PERSIST})
54  	@JoinColumn(name="CAMPUS_TYP_CD", insertable=false, updatable=false)
55  	private CampusType campusType;
56      
57      /**
58       * Default no-arg constructor.
59       */
60      public CampusImpl() {
61  
62      }
63  
64      /**
65  	 * This overridden method ...
66  	 * 
67  	 * @see org.kuali.rice.kns.bo.Campus#getCampusCode()
68  	 */
69      public String getCampusCode() {
70          return campusCode;
71      }
72  
73      /**
74       * Sets the campusCode attribute.
75       * 
76       * @param campusCode The campusCode to set.
77       * 
78       */
79      public void setCampusCode(String campusCode) {
80          this.campusCode = campusCode;
81      }
82  
83      /**
84  	 * This overridden method ...
85  	 * 
86  	 * @see org.kuali.rice.kns.bo.Campus#getCampusName()
87  	 */
88      public String getCampusName() {
89          return campusName;
90      }
91  
92      /**
93       * Sets the campusName attribute.
94       * 
95       * @param campusName The campusName to set.
96       * 
97       */
98      public void setCampusName(String campusName) {
99          this.campusName = campusName;
100     }
101 
102     /**
103 	 * This overridden method ...
104 	 * 
105 	 * @see org.kuali.rice.kns.bo.Campus#getCampusShortName()
106 	 */
107     public String getCampusShortName() {
108         return campusShortName;
109     }
110 
111     /**
112      * Sets the campusShortName attribute.
113      * 
114      * @param campusShortName The campusShortName to set.
115      * 
116      */
117     public void setCampusShortName(String campusShortName) {
118         this.campusShortName = campusShortName;
119     }
120 
121     /**
122 	 * This overridden method ...
123 	 * 
124 	 * @see org.kuali.rice.kns.bo.Campus#getCampusTypeCode()
125 	 */
126     public String getCampusTypeCode() {
127         return campusTypeCode;
128     }
129 
130     /**
131      * Sets the campusTypeCode attribute.
132      * 
133      * @param campusTypeCode The campusTypeCode to set.
134      * 
135      */
136     public void setCampusTypeCode(String campusTypeCode) {
137         this.campusTypeCode = campusTypeCode;
138     }
139 
140     /**
141 	 * This overridden method ...
142 	 * 
143 	 * @see org.kuali.rice.kns.bo.Campus#getCampusType()
144 	 */
145     public CampusType getCampusType() {
146         return campusType;
147     }
148 
149     /**
150      * Sets the campusType attribute value.
151      * @param campusType The campusType to set.
152      * @deprecated
153      */
154     public void setCampusType(CampusType campusType) {
155         this.campusType = campusType;
156     }
157 
158 	/**
159 	 * This overridden method ...
160 	 * 
161 	 * @see org.kuali.rice.kns.bo.Campus#isActive()
162 	 */
163 	public boolean isActive() {
164 		return this.active;
165 	}
166 
167 	/**
168 	 * @param active the active to set
169 	 */
170 	public void setActive(boolean active) {
171 		this.active = active;
172 	}
173 	
174     /**
175      * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
176      */
177     protected LinkedHashMap toStringMapper() {
178         LinkedHashMap m = new LinkedHashMap();
179         m.put(KNSPropertyConstants.CAMPUS_CODE, this.campusCode);
180         return m;
181     }
182 
183 }
184