1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.ole.coa.businessobject;
18
19 import java.util.HashMap;
20 import java.util.LinkedHashMap;
21 import java.util.List;
22 import java.util.Map;
23
24 import org.apache.log4j.Logger;
25 import org.kuali.ole.sys.OLEPropertyConstants;
26 import org.kuali.ole.sys.context.SpringContext;
27 import org.kuali.rice.krad.bo.GlobalBusinessObjectDetailBase;
28 import org.kuali.rice.krad.service.PersistenceStructureService;
29 import org.kuali.rice.krad.util.ObjectUtils;
30
31
32
33
34 public class AccountGlobalDetail extends GlobalBusinessObjectDetailBase {
35
36 private static final long serialVersionUID = -6329389744704772474L;
37 private static final Logger LOG = Logger.getLogger(AccountGlobalDetail.class);
38
39 private String chartOfAccountsCode;
40 private String accountNumber;
41
42
43 transient private Chart chartOfAccounts;
44 transient private Account account;
45
46
47
48
49 public AccountGlobalDetail() {
50
51 }
52
53
54
55
56
57 public Map<String, Object> getPrimaryKeys() {
58 try {
59 List<String> keys = SpringContext.getBean(PersistenceStructureService.class).getPrimaryKeys(Account.class);
60 HashMap<String, Object> pks = new HashMap<String, Object>(keys.size());
61 for (String key : keys) {
62
63
64
65 pks.put(key, ObjectUtils.getPropertyValue(this, key));
66 }
67 return pks;
68 }
69 catch (Exception ex) {
70 LOG.error("unable to get primary keys for global detail object", ex);
71 }
72 return new HashMap<String, Object>(0);
73 }
74
75 public AccountGlobalDetail(String chartOfAccountsCode, String accountNumber) {
76 this.chartOfAccountsCode = chartOfAccountsCode;
77 this.accountNumber = accountNumber;
78 }
79
80
81
82
83
84
85 public String getChartOfAccountsCode() {
86 return chartOfAccountsCode;
87 }
88
89
90
91
92
93
94 public void setChartOfAccountsCode(String chartOfAccountsCode) {
95 this.chartOfAccountsCode = chartOfAccountsCode;
96 }
97
98
99
100
101
102
103
104 public String getAccountNumber() {
105 return accountNumber;
106 }
107
108
109
110
111
112
113 public void setAccountNumber(String accountNumber) {
114 this.accountNumber = accountNumber;
115 }
116
117
118
119
120
121
122 public Chart getChartOfAccounts() {
123 return chartOfAccounts;
124 }
125
126
127
128
129
130
131
132 public void setChartOfAccounts(Chart chartOfAccounts) {
133 this.chartOfAccounts = chartOfAccounts;
134 }
135
136
137
138
139
140
141 public Account getAccount() {
142 return account;
143 }
144
145
146
147
148
149
150
151 public void setAccount(Account account) {
152 this.account = account;
153 }
154
155
156
157
158 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
159 LinkedHashMap m = new LinkedHashMap();
160 m.put(OLEPropertyConstants.DOCUMENT_NUMBER, getDocumentNumber());
161 m.put("chartOfAccountsCode", this.chartOfAccountsCode);
162 m.put("accountNumber", this.accountNumber);
163 return m;
164 }
165 }