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.sql.Timestamp;
024: import java.util.Date;
025:
026: import org.apache.commons.lang.builder.EqualsBuilder;
027: import org.apache.commons.lang.builder.HashCodeBuilder;
028: import org.apache.commons.lang.builder.ToStringBuilder;
029: import org.apache.ojb.broker.PersistenceBroker;
030: import org.apache.ojb.broker.PersistenceBrokerAware;
031: import org.apache.ojb.broker.PersistenceBrokerException;
032:
033: /**
034: * @author delyea
035: * @hibernate.class table="PDP.PDP_PMT_ACCT_HIST_T"
036: */
037:
038: public class PaymentAccountHistory implements Serializable,
039: PersistenceBrokerAware {
040:
041: private Integer id; // PMT_ACCT_HIST_ID
042:
043: private String accountingChangeCode;
044: private AccountingChange accountingChange; // ACCTG_CHG_CD
045:
046: private String acctAttributeName; // ACCT_ATTRIB_NM
047: private String acctAttributeOrigValue; // ACCT_ATTRIB_ORIG_VAL
048: private String acctAttributeNewValue; // ACCT_ATTRIB_NEW_VAL
049: private Timestamp acctChangeDate; // ACCT_CHG_TS
050: private Timestamp lastUpdate;
051: private Integer version; // VER_NBR
052:
053: private Integer paymentAccountDetailId;
054: private PaymentAccountDetail paymentAccountDetail; // PMT_ACCT_DTL_ID
055:
056: public PaymentAccountHistory() {
057: super ();
058: }
059:
060: /**
061: * @hibernate.many-to-one column="PMT_ACCT_DTL_ID" class="edu.iu.uis.pdp.bo.PaymentAccountHistory"
062: * @return Returns the accountDetailId.
063: */
064: public PaymentAccountDetail getPaymentAccountDetail() {
065: return paymentAccountDetail;
066: }
067:
068: /**
069: * @param accountDetailId The accountDetailId to set.
070: */
071: public void setPaymentAccountDetail(PaymentAccountDetail pad) {
072: this .paymentAccountDetail = pad;
073: }
074:
075: /**
076: * @hibernate.id column="PMT_ACCT_HIST_ID" generator-class="sequence"
077: * @hibernate.generator-param name="sequence" value="PDP.PDP_PMT_ACCT_HIST_ID_SEQ"
078: * @return Returns the Id.
079: */
080: public Integer getId() {
081: return id;
082: }
083:
084: /**
085: * @return
086: * @hibernate.version column="VER_NBR" not-null="true"
087: */
088: public Integer getVersion() {
089: return version;
090: }
091:
092: /**
093: * @return
094: * @hibernate.property column="ACCT_ATTRIB_NM" length="25"
095: */
096: public String getAcctAttributeName() {
097: return acctAttributeName;
098: }
099:
100: /**
101: * @return
102: * @hibernate.property column="ACCT_ATTRIB_NEW_VAL" length="15"
103: */
104: public String getAcctAttributeNewValue() {
105: return acctAttributeNewValue;
106: }
107:
108: /**
109: * @return
110: * @hibernate.property column="ACCT_ATTRIB_ORIG_VAL" length="15"
111: */
112: public String getAcctAttributeOrigValue() {
113: return acctAttributeOrigValue;
114: }
115:
116: /**
117: * @return
118: * @hibernate.many-to-one column="ACCTG_CHG_CD" class="edu.iu.uis.pdp.bo.AccountingChange"
119: */
120: public AccountingChange getAccountingChange() {
121: return accountingChange;
122: }
123:
124: /**
125: * @return
126: * @hibernate.property column="ACCT_CHG_TS"
127: */
128: public Timestamp getAcctChangeDate() {
129: return acctChangeDate;
130: }
131:
132: /**
133: * @param string
134: */
135: public void setAcctAttributeName(String string) {
136: acctAttributeName = string;
137: }
138:
139: /**
140: * @param string
141: */
142: public void setAcctAttributeNewValue(String string) {
143: acctAttributeNewValue = string;
144: }
145:
146: /**
147: * @param string
148: */
149: public void setAcctAttributeOrigValue(String string) {
150: acctAttributeOrigValue = string;
151: }
152:
153: /**
154: * @param string
155: */
156: public void setAccountingChange(AccountingChange ac) {
157: accountingChange = ac;
158: }
159:
160: /**
161: * @param timestamp
162: */
163: public void setAcctChangeDate(Timestamp timestamp) {
164: acctChangeDate = timestamp;
165: }
166:
167: /**
168: * @param integer
169: */
170: public void setId(Integer integer) {
171: id = integer;
172: }
173:
174: /**
175: * @param integer
176: */
177: public void setVersion(Integer integer) {
178: version = integer;
179: }
180:
181: public boolean equals(Object obj) {
182: if (!(obj instanceof PaymentAccountHistory)) {
183: return false;
184: }
185: PaymentAccountHistory o = (PaymentAccountHistory) obj;
186: return new EqualsBuilder().append(id, o.getId()).isEquals();
187: }
188:
189: public int hashCode() {
190: return new HashCodeBuilder(79, 91).append(id).toHashCode();
191: }
192:
193: public String toString() {
194: return new ToStringBuilder(this ).append("id", this .id)
195: .toString();
196: }
197:
198: /**
199: * @return Returns the lastUpdate.
200: */
201: public Timestamp getLastUpdate() {
202: return lastUpdate;
203: }
204:
205: /**
206: * @param lastUpdate The lastUpdate to set.
207: */
208: public void setLastUpdate(Timestamp lastUpdate) {
209: this .lastUpdate = lastUpdate;
210: }
211:
212: public void beforeInsert(PersistenceBroker broker)
213: throws PersistenceBrokerException {
214: lastUpdate = new Timestamp((new Date()).getTime());
215: }
216:
217: public void afterInsert(PersistenceBroker broker)
218: throws PersistenceBrokerException {
219:
220: }
221:
222: public void beforeUpdate(PersistenceBroker broker)
223: throws PersistenceBrokerException {
224: lastUpdate = new Timestamp((new Date()).getTime());
225: }
226:
227: public void afterUpdate(PersistenceBroker broker)
228: throws PersistenceBrokerException {
229:
230: }
231:
232: public void beforeDelete(PersistenceBroker broker)
233: throws PersistenceBrokerException {
234:
235: }
236:
237: public void afterDelete(PersistenceBroker broker)
238: throws PersistenceBrokerException {
239:
240: }
241:
242: public void afterLookup(PersistenceBroker broker)
243: throws PersistenceBrokerException {
244:
245: }
246: }
|