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: import org.kuali.core.bo.user.UniversalUser;
033: import org.kuali.core.exceptions.UserNotFoundException;
034: import org.kuali.core.service.UniversalUserService;
035:
036: /**
037: * @author delyea
038: * @hibernate.class table="PDP.PDP_DISB_NBR_RANGE_T"
039: */
040: public class DisbursementNumberRange implements UserRequired,
041: Serializable, PersistenceBrokerAware {
042:
043: private Integer id; // DISB_NBR_RANGE_ID
044: private String physCampusProcCode; // PHYS_CMP_PROC_CD
045: private Integer beginDisbursementNbr; // BEG_DISB_NBR
046: private Integer lastAssignedDisbNbr; // LST_ASND_DISB_NBR
047: private Integer endDisbursementNbr; // END_DISB_NBR
048: private Timestamp disbNbrEffectiveDt; // DISB_NBR_EFF_DT
049: private Timestamp disbNbrExpirationDt; // DISB_NBR_EXPR_DT
050: private Timestamp lastUpdate; // LST_UPDT_TS
051: private PdpUser lastUpdateUser;
052: private String lastUpdateUserId; // LST_UPDT_USR_ID
053: private Integer version; // VER_NBR
054:
055: private Integer bankId;
056: private Bank bank;
057:
058: public DisbursementNumberRange() {
059: super ();
060: }
061:
062: public PdpUser getLastUpdateUser() {
063: return lastUpdateUser;
064: }
065:
066: public void setLastUpdateUser(PdpUser s) {
067: if (s != null) {
068: this .lastUpdateUserId = s.getUniversalUser()
069: .getPersonUniversalIdentifier();
070: } else {
071: this .lastUpdateUserId = null;
072: }
073: this .lastUpdateUser = s;
074: }
075:
076: public String getLastUpdateUserId() {
077: return lastUpdateUserId;
078: }
079:
080: public void setLastUpdateUserId(String lastUpdateUserId) {
081: this .lastUpdateUserId = lastUpdateUserId;
082: }
083:
084: public void updateUser(UniversalUserService userService)
085: throws UserNotFoundException {
086: UniversalUser u = userService
087: .getUniversalUser(lastUpdateUserId);
088: if (u == null) {
089: setLastUpdateUser(null);
090: } else {
091: setLastUpdateUser(new PdpUser(u));
092: }
093: }
094:
095: /**
096: * @hibernate.id column="DISB_NBR_RANGE_ID" generator-class="sequence"
097: * @hibernate.generator-param name="sequence" value="PDP.PDP_DISB_NBR_RANGE_ID_SEQ"
098: * @return
099: */
100: public Integer getId() {
101: return id;
102: }
103:
104: /**
105: * @param documentTypeId The documentTypeId to set.
106: */
107: public void setId(Integer documentTypeId) {
108: this .id = documentTypeId;
109: }
110:
111: /**
112: * @return
113: * @hibernate.property column="LST_UPDT_TS" not-null="true"
114: */
115: public Timestamp getLastUpdate() {
116: return lastUpdate;
117: }
118:
119: /**
120: * @return
121: * @hibernate.version column="VER_NBR" not-null="true"
122: */
123: public Integer getVersion() {
124: return version;
125: }
126:
127: /**
128: * @return
129: * @hibernate.many-to-one class="edu.iu.uis.pdp.bo.Bank" column="BNK_ID" not-null="true"
130: */
131: public Bank getBank() {
132: return bank;
133: }
134:
135: /**
136: * @return
137: * @hibernate.property column="BEG_DISB_NBR"
138: */
139: public Integer getBeginDisbursementNbr() {
140: return beginDisbursementNbr;
141: }
142:
143: /**
144: * @return
145: * @hibernate.property column="DISB_NBR_EFF_DT"
146: */
147: public Timestamp getDisbNbrEffectiveDt() {
148: return disbNbrEffectiveDt;
149: }
150:
151: /**
152: * @return
153: * @hibernate.property column="DISB_NBR_EXPR_DT"
154: */
155: public Timestamp getDisbNbrExpirationDt() {
156: return disbNbrExpirationDt;
157: }
158:
159: /**
160: * @return
161: * @hibernate.property column="END_DISB_NBR"
162: */
163: public Integer getEndDisbursementNbr() {
164: return endDisbursementNbr;
165: }
166:
167: /**
168: * @return
169: * @hibernate.property column="LST_ASND_DISB_NBR"
170: */
171: public Integer getLastAssignedDisbNbr() {
172: return lastAssignedDisbNbr;
173: }
174:
175: /**
176: * @return
177: * @hibernate.property column="PHYS_CMP_PROC_CD" length="2"
178: */
179: public String getPhysCampusProcCode() {
180: return physCampusProcCode;
181: }
182:
183: /**
184: * @param integer
185: */
186: public void setBank(Bank bank) {
187: this .bank = bank;
188: }
189:
190: /**
191: * @param integer
192: */
193: public void setBeginDisbursementNbr(Integer integer) {
194: beginDisbursementNbr = integer;
195: }
196:
197: /**
198: * @param timestamp
199: */
200: public void setDisbNbrEffectiveDt(Timestamp timestamp) {
201: disbNbrEffectiveDt = timestamp;
202: }
203:
204: /**
205: * @param timestamp
206: */
207: public void setDisbNbrExpirationDt(Timestamp timestamp) {
208: disbNbrExpirationDt = timestamp;
209: }
210:
211: /**
212: * @param integer
213: */
214: public void setEndDisbursementNbr(Integer integer) {
215: endDisbursementNbr = integer;
216: }
217:
218: /**
219: * @param integer
220: */
221: public void setLastAssignedDisbNbr(Integer integer) {
222: lastAssignedDisbNbr = integer;
223: }
224:
225: /**
226: * @param timestamp
227: */
228: public void setLastUpdate(Timestamp timestamp) {
229: lastUpdate = timestamp;
230: }
231:
232: /**
233: * @param string
234: */
235: public void setPhysCampusProcCode(String string) {
236: physCampusProcCode = string;
237: }
238:
239: /**
240: * @param integer
241: */
242: public void setVersion(Integer integer) {
243: version = integer;
244: }
245:
246: public boolean equals(Object obj) {
247: if (!(obj instanceof DisbursementNumberRange)) {
248: return false;
249: }
250: DisbursementNumberRange o = (DisbursementNumberRange) obj;
251: return new EqualsBuilder().append(id, o.getId()).isEquals();
252: }
253:
254: public int hashCode() {
255: return new HashCodeBuilder(83, 43).append(id).toHashCode();
256: }
257:
258: public String toString() {
259: return new ToStringBuilder(this ).append("id", this .id)
260: .toString();
261: }
262:
263: public void beforeInsert(PersistenceBroker broker)
264: throws PersistenceBrokerException {
265: lastUpdate = new Timestamp((new Date()).getTime());
266: }
267:
268: public void afterInsert(PersistenceBroker broker)
269: throws PersistenceBrokerException {
270:
271: }
272:
273: public void beforeUpdate(PersistenceBroker broker)
274: throws PersistenceBrokerException {
275: lastUpdate = new Timestamp((new Date()).getTime());
276: }
277:
278: public void afterUpdate(PersistenceBroker broker)
279: throws PersistenceBrokerException {
280:
281: }
282:
283: public void beforeDelete(PersistenceBroker broker)
284: throws PersistenceBrokerException {
285:
286: }
287:
288: public void afterDelete(PersistenceBroker broker)
289: throws PersistenceBrokerException {
290:
291: }
292:
293: public void afterLookup(PersistenceBroker broker)
294: throws PersistenceBrokerException {
295:
296: }
297: }
|