001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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: */
016: /*
017: * Created on Jul 12, 2004
018: *
019: */
020: package org.kuali.module.pdp.bo;
021:
022: import java.io.Serializable;
023: import java.math.BigDecimal;
024: import java.sql.Timestamp;
025: import java.util.ArrayList;
026: import java.util.Date;
027: import java.util.List;
028:
029: import org.apache.commons.lang.builder.EqualsBuilder;
030: import org.apache.commons.lang.builder.HashCodeBuilder;
031: import org.apache.commons.lang.builder.ToStringBuilder;
032: import org.apache.ojb.broker.PersistenceBroker;
033: import org.apache.ojb.broker.PersistenceBrokerAware;
034: import org.apache.ojb.broker.PersistenceBrokerException;
035:
036: /**
037: * @author delyea
038: * @hibernate.class table="PDP.PDP_PMT_ACCT_DTL_T"
039: */
040:
041: public class PaymentAccountDetail implements Serializable,
042: PersistenceBrokerAware {
043:
044: private Integer id; // PMT_ACCT_DTL_ID
045: private String finChartCode; // FIN_COA_CD
046: private String accountNbr; // ACCOUNT_NBR
047: private String subAccountNbr; // SUB_ACCT_NBR
048: private String finObjectCode; // FIN_OBJECT_CD
049: private String finSubObjectCode; // FIN_SUB_OBJ_CD
050: private String orgReferenceId; // ORG_REFERENCE_ID
051: private String projectCode; // PROJECT_CD
052: private BigDecimal accountNetAmount; // ACCT_NET_AMT
053: private Timestamp lastUpdate;
054: private Integer version; // VER_NBR
055:
056: private Integer paymentDetailId;
057: private PaymentDetail paymentDetail; // PMT_DTL_ID
058:
059: private List accountHistory = new ArrayList();
060:
061: public PaymentAccountDetail() {
062: super ();
063: }
064:
065: public List getAccountHistory() {
066: return accountHistory;
067: }
068:
069: public void setAccountHistory(List ah) {
070: accountHistory = ah;
071: }
072:
073: public void addAccountHistory(PaymentAccountHistory pah) {
074: pah.setPaymentAccountDetail(this );
075: accountHistory.add(pah);
076: }
077:
078: public void deleteAccountDetail(PaymentAccountHistory pah) {
079: accountHistory.remove(pah);
080: }
081:
082: /**
083: * @hibernate.id column="PMT_ACCT_DTL_ID" generator-class="sequence"
084: * @hibernate.generator-param name="sequence" value="PDP.PDP_PMT_ACCT_DTL_ID_SEQ"
085: * @return
086: */
087: public Integer getId() {
088: return id;
089: }
090:
091: /**
092: * @return
093: * @hibernate.version column="VER_NBR" not-null="true"
094: */
095: public Integer getVersion() {
096: return version;
097: }
098:
099: /**
100: * @return
101: * @hibernate.many-to-one column="PMT_DTL_ID" class="edu.iu.uis.pdp.bo.PaymentDetail"
102: */
103: public PaymentDetail getPaymentDetail() {
104: return this .paymentDetail;
105: }
106:
107: /**
108: * @return
109: * @hibernate.property column="ACCOUNT_NBR" length="7"
110: */
111: public String getAccountNbr() {
112: return accountNbr;
113: }
114:
115: /**
116: * @return
117: * @hibernate.property column="ACCT_NET_AMT" length="14"
118: */
119: public BigDecimal getAccountNetAmount() {
120: return accountNetAmount;
121: }
122:
123: /**
124: * @return
125: * @hibernate.property column="FIN_COA_CD" length="2"
126: */
127: public String getFinChartCode() {
128: return finChartCode;
129: }
130:
131: /**
132: * @return
133: * @hibernate.property column="FIN_OBJECT_CD" length="4"
134: */
135: public String getFinObjectCode() {
136: return finObjectCode;
137: }
138:
139: /**
140: * @return
141: * @hibernate.property column="FIN_SUB_OBJ_CD" length="3"
142: */
143: public String getFinSubObjectCode() {
144: return finSubObjectCode;
145: }
146:
147: /**
148: * @return
149: * @hibernate.property column="ORG_REFERENCE_ID" length="8"
150: */
151: public String getOrgReferenceId() {
152: return orgReferenceId;
153: }
154:
155: /**
156: * @return
157: * @hibernate.property column="PROJECT_CD" length="10"
158: */
159: public String getProjectCode() {
160: return projectCode;
161: }
162:
163: /**
164: * @return
165: * @hibernate.property column="SUB_ACCT_NBR" length="5"
166: */
167: public String getSubAccountNbr() {
168: return subAccountNbr;
169: }
170:
171: /**
172: * @param string
173: */
174: public void setAccountNbr(String string) {
175: accountNbr = string;
176: }
177:
178: /**
179: * @param string
180: */
181: public void setAccountNetAmount(BigDecimal bigdecimal) {
182: accountNetAmount = bigdecimal;
183: }
184:
185: /**
186: * @param integer
187: */
188: public void setPaymentDetail(PaymentDetail pd) {
189: paymentDetail = pd;
190: }
191:
192: /**
193: * @param string
194: */
195: public void setFinChartCode(String string) {
196: finChartCode = string;
197: }
198:
199: /**
200: * @param string
201: */
202: public void setFinObjectCode(String string) {
203: finObjectCode = string;
204: }
205:
206: /**
207: * @param string
208: */
209: public void setFinSubObjectCode(String string) {
210: finSubObjectCode = string;
211: }
212:
213: /**
214: * @param integer
215: */
216: public void setId(Integer integer) {
217: id = integer;
218: }
219:
220: /**
221: * @param string
222: */
223: public void setOrgReferenceId(String string) {
224: orgReferenceId = string;
225: }
226:
227: /**
228: * @param string
229: */
230: public void setProjectCode(String string) {
231: projectCode = string;
232: }
233:
234: /**
235: * @param string
236: */
237: public void setSubAccountNbr(String string) {
238: subAccountNbr = string;
239: }
240:
241: /**
242: * @param integer
243: */
244: public void setVersion(Integer integer) {
245: version = integer;
246: }
247:
248: public boolean equals(Object obj) {
249: if (!(obj instanceof PaymentAccountDetail)) {
250: return false;
251: }
252: PaymentAccountDetail o = (PaymentAccountDetail) obj;
253: return new EqualsBuilder().append(id, o.getId()).isEquals();
254: }
255:
256: public int hashCode() {
257: return new HashCodeBuilder(59, 67).append(id).toHashCode();
258: }
259:
260: public String toString() {
261: return new ToStringBuilder(this ).append("id", this .id)
262: .toString();
263: }
264:
265: /**
266: * @return Returns the lastUpdate.
267: */
268: public Timestamp getLastUpdate() {
269: return lastUpdate;
270: }
271:
272: /**
273: * @param lastUpdate The lastUpdate to set.
274: */
275: public void setLastUpdate(Timestamp lastUpdate) {
276: this .lastUpdate = lastUpdate;
277: }
278:
279: public void beforeInsert(PersistenceBroker broker)
280: throws PersistenceBrokerException {
281: lastUpdate = new Timestamp((new Date()).getTime());
282: }
283:
284: public void afterInsert(PersistenceBroker broker)
285: throws PersistenceBrokerException {
286:
287: }
288:
289: public void beforeUpdate(PersistenceBroker broker)
290: throws PersistenceBrokerException {
291: lastUpdate = new Timestamp((new Date()).getTime());
292: }
293:
294: public void afterUpdate(PersistenceBroker broker)
295: throws PersistenceBrokerException {
296:
297: }
298:
299: public void beforeDelete(PersistenceBroker broker)
300: throws PersistenceBrokerException {
301:
302: }
303:
304: public void afterDelete(PersistenceBroker broker)
305: throws PersistenceBrokerException {
306:
307: }
308:
309: public void afterLookup(PersistenceBroker broker)
310: throws PersistenceBrokerException {
311:
312: }
313: }
|