01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.labor.util.testobject;
17:
18: import java.util.ArrayList;
19: import java.util.List;
20: import java.util.Map;
21:
22: import org.kuali.kfs.KFSPropertyConstants;
23: import org.kuali.module.labor.bo.LedgerEntry;
24: import org.kuali.module.labor.util.ObjectUtil;
25:
26: public class LedgerEntryForTesting extends LedgerEntry {
27: @Override
28: public boolean equals(Object otherLedgerEntry) {
29: return ObjectUtil.compareObject(this , otherLedgerEntry,
30: getPrimaryKeyList());
31: }
32:
33: public Map getPrimaryKeyMap() {
34: return ObjectUtil.buildPropertyMap(this , this
35: .getPrimaryKeyList());
36: }
37:
38: public List<String> getPrimaryKeyList() {
39: List<String> primaryKeyList = new ArrayList<String>();
40: primaryKeyList.add(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR);
41: primaryKeyList.add(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE);
42: primaryKeyList.add(KFSPropertyConstants.ACCOUNT_NUMBER);
43: primaryKeyList.add(KFSPropertyConstants.SUB_ACCOUNT_NUMBER);
44: primaryKeyList.add(KFSPropertyConstants.FINANCIAL_OBJECT_CODE);
45: primaryKeyList
46: .add(KFSPropertyConstants.FINANCIAL_SUB_OBJECT_CODE);
47: primaryKeyList
48: .add(KFSPropertyConstants.FINANCIAL_BALANCE_TYPE_CODE);
49: primaryKeyList
50: .add(KFSPropertyConstants.FINANCIAL_OBJECT_TYPE_CODE);
51: primaryKeyList
52: .add(KFSPropertyConstants.UNIVERSITY_FISCAL_PERIOD_CODE);
53: primaryKeyList
54: .add(KFSPropertyConstants.FINANCIAL_DOCUMENT_TYPE_CODE);
55: primaryKeyList
56: .add(KFSPropertyConstants.FINANCIAL_SYSTEM_ORIGINATION_CODE);
57: primaryKeyList.add(KFSPropertyConstants.DOCUMENT_NUMBER);
58: primaryKeyList
59: .add(KFSPropertyConstants.TRANSACTION_ENTRY_SEQUENCE_NUMBER);
60: return primaryKeyList;
61: }
62: }
|