View Javadoc
1   /*
2    * Copyright 2007 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.ole.coa.businessobject;
17  
18  import java.util.LinkedHashMap;
19  import javax.persistence.Column;
20  import javax.persistence.Convert;
21  import javax.persistence.Entity;
22  import javax.persistence.Id;
23  import javax.persistence.Table;
24  import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
25  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
26  import org.kuali.rice.krad.data.jpa.converters.BooleanYNConverter;
27  
28  @Entity
29  @Table(name = "CA_ACCTG_CTGRY_T")
30  public class BasicAccountingCategory extends PersistableBusinessObjectBase implements MutableInactivatable {
31  
32      @Id
33      @Column(name = "ACCTG_CTGRY_CD")
34      private String code;
35  
36      @Column(name = "ACCTG_CTGRY_DESC")
37      private String description;
38  
39      @Column(name = "ACCTG_CTGRY_SHRT_NM")
40      private String shortName;
41  
42      @Column(name = "FIN_REPORT_SORT_CD")
43      private String sortCode;
44  
45      @Column(name = "ROW_ACTV_IND")
46      @Convert(converter = BooleanYNConverter.class)
47      private boolean active;
48  
49      /**
50       * Default constructor.
51       */
52      public BasicAccountingCategory() {
53  
54      }
55  
56      /**
57       * Gets the accountCategoryCode attribute.
58       * 
59       * @return Returns the accountCategoryCode
60       */
61      public String getCode() {
62          return code;
63      }
64  
65      /**
66       * Sets the accountCategoryCode attribute.
67       * 
68       * @param accountCategoryCode The accountCategoryCode to set.
69       */
70      public void setCode(String basicAccountingCategoryCode) {
71          this.code = basicAccountingCategoryCode;
72      }
73  
74  
75      /**
76       * Gets the description attribute.
77       * 
78       * @return Returns the description
79       */
80      public String getDescription() {
81          return description;
82      }
83  
84      /**
85       * Sets the description attribute.
86       * 
87       * @param description The description to set.
88       */
89      public void setDescription(String accountCategoryDescription) {
90          this.description = accountCategoryDescription;
91      }
92  
93  
94      /**
95       * Gets the accountCategoryShortName attribute.
96       * 
97       * @return Returns the accountCategoryShortName
98       */
99      public String getShortName() {
100         return shortName;
101     }
102 
103     /**
104      * Sets the accountCategoryShortName attribute.
105      * 
106      * @param accountCategoryShortName The accountCategoryShortName to set.
107      */
108     public void setShortName(String basicAccountingCategoryShortName) {
109         this.shortName = basicAccountingCategoryShortName;
110     }
111 
112 
113     /**
114      * Gets the sortCode attribute.
115      * 
116      * @return Returns the sortCode
117      */
118     public String getSortCode() {
119         return sortCode;
120     }
121 
122     /**
123      * Sets the sortCode attribute.
124      * 
125      * @param sortCode The sortCode to set.
126      */
127     public void setSortCode(String financialReportingSortCode) {
128         this.sortCode = financialReportingSortCode;
129     }
130 
131     /**
132      * Gets the active attribute.
133      * 
134      * @return Returns the active.
135      */
136     public boolean isActive() {
137         return active;
138     }
139 
140     /**
141      * Sets the active attribute.
142      * 
143      * @param active The active to set.
144      */
145     public void setActive(boolean active) {
146         this.active = active;
147     }
148 
149     /**
150      * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
151      */
152     protected LinkedHashMap toStringMapper() {
153         LinkedHashMap m = new LinkedHashMap();
154         m.put("accountCategoryCode", this.code);
155         return m;
156     }
157 
158     /**
159      * This method generates a standard String of the code and description together
160      * 
161      * @return string representation of the code and description for this Account Category.
162      */
163     public String getCodeAndDescription() {
164         StringBuilder codeAndDescription = new StringBuilder();
165         codeAndDescription.append(this.getCode());
166         codeAndDescription.append(" - ");
167         codeAndDescription.append(this.getDescription());
168         return codeAndDescription.toString();
169     }
170 }