1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
package model.entity;
import oracle.jbo.Key;
import oracle.jbo.server.AttributeDefImpl;
import oracle.jbo.server.EntityDefImpl;
import oracle.jbo.server.EntityImpl;
// ---------------------------------------------------------------------
// --- File generated by Oracle ADF Business Components Design Time.
// --- Mon Aug 19 12:01:47 CST 2013
// --- Custom code may be added to this class.
// --- Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class CoffeesEOImpl extends EntityImpl {
public void lock() {
//super.lock();
}
protected StringBuffer buildDMLStatement(int i, AttributeDefImpl[] attributeDefImpl,
AttributeDefImpl[] attributeDefImpl2,
AttributeDefImpl[] attributeDefImpl3, boolean b) {
StringBuffer stmt = super.buildDMLStatement(i, attributeDefImpl, attributeDefImpl2, attributeDefImpl3, b);
if (i == DML_UPDATE) {
// Get the alias name (it is equal to the entity definition name)
String alias = this.getEntityDef().getDefName();
// Remove the alias from the UPDATE statement
int index = stmt.indexOf( " " + alias + " SET ");
if (index != -1)
stmt = stmt.replace( index, index + alias.length() + 1, "");
}
return stmt;
}
/**
* AttributesEnum: generated enum for identifying attributes and accessors. Do not modify.
*/
public enum AttributesEnum {
CofName {
public Object get(CoffeesEOImpl obj) {
return obj.getCofName();
}
public void put(CoffeesEOImpl obj, Object value) {
obj.setCofName((String)value);
}
}
,
SupId {
public Object get(CoffeesEOImpl obj) {
return obj.getSupId();
}
public void put(CoffeesEOImpl obj, Object value) {
obj.setSupId((Integer)value);
}
}
,
Price {
public Object get(CoffeesEOImpl obj) {
return obj.getPrice();
}
public void put(CoffeesEOImpl obj, Object value) {
obj.setPrice((Float)value);
}
}
,
Sales {
public Object get(CoffeesEOImpl obj) {
return obj.getSales();
}
public void put(CoffeesEOImpl obj, Object value) {
obj.setSales((Integer)value);
}
}
,
Total {
public Object get(CoffeesEOImpl obj) {
return obj.getTotal();
}
public void put(CoffeesEOImpl obj, Object value) {
obj.setTotal((Integer)value);
}
}
,
SuppliersEO {
public Object get(CoffeesEOImpl obj) {
return obj.getSuppliersEO();
}
public void put(CoffeesEOImpl obj, Object value) {
obj.setSuppliersEO((SuppliersEOImpl)value);
}
}
;
private static AttributesEnum[] vals = null;
private static int firstIndex = 0;
public abstract Object get(CoffeesEOImpl object);
public abstract void put(CoffeesEOImpl object, Object value);
public int index() {
return AttributesEnum.firstIndex() + ordinal();
}
public static int firstIndex() {
return firstIndex;
}
public static int count() {
return AttributesEnum.firstIndex() + AttributesEnum.staticValues().length;
}
public static AttributesEnum[] staticValues() {
if (vals == null) {
vals = AttributesEnum.values();
}
return vals;
}
}
public static final int COFNAME = AttributesEnum.CofName.index();
public static final int SUPID = AttributesEnum.SupId.index();
public static final int PRICE = AttributesEnum.Price.index();
public static final int SALES = AttributesEnum.Sales.index();
public static final int TOTAL = AttributesEnum.Total.index();
public static final int SUPPLIERSEO = AttributesEnum.SuppliersEO.index();
/**
* This is the default constructor (do not remove).
*/
public CoffeesEOImpl() {
}
/**
* @return the definition object for this instance class.
*/
public static synchronized EntityDefImpl getDefinitionObject() {
return EntityDefImpl.findDefObject("model.entity.CoffeesEO");
}
/**
* Gets the attribute value for CofName, using the alias name CofName.
* @return the value of CofName
*/
public String getCofName() {
return (String)getAttributeInternal(COFNAME);
}
/**
* Sets <code>value</code> as the attribute value for CofName.
* @param value value to set the CofName
*/
public void setCofName(String value) {
setAttributeInternal(COFNAME, value);
}
/**
* Gets the attribute value for SupId, using the alias name SupId.
* @return the value of SupId
*/
public Integer getSupId() {
return (Integer)getAttributeInternal(SUPID);
}
/**
* Sets <code>value</code> as the attribute value for SupId.
* @param value value to set the SupId
*/
public void setSupId(Integer value) {
setAttributeInternal(SUPID, value);
}
/**
* Gets the attribute value for Price, using the alias name Price.
* @return the value of Price
*/
public Float getPrice() {
return (Float)getAttributeInternal(PRICE);
}
/**
* Sets <code>value</code> as the attribute value for Price.
* @param value value to set the Price
*/
public void setPrice(Float value) {
setAttributeInternal(PRICE, value);
}
/**
* Gets the attribute value for Sales, using the alias name Sales.
* @return the value of Sales
*/
public Integer getSales() {
return (Integer)getAttributeInternal(SALES);
}
/**
* Sets <code>value</code> as the attribute value for Sales.
* @param value value to set the Sales
*/
public void setSales(Integer value) {
setAttributeInternal(SALES, value);
}
/**
* Gets the attribute value for Total, using the alias name Total.
* @return the value of Total
*/
public Integer getTotal() {
return (Integer)getAttributeInternal(TOTAL);
}
/**
* Sets <code>value</code> as the attribute value for Total.
* @param value value to set the Total
*/
public void setTotal(Integer value) {
setAttributeInternal(TOTAL, value);
}
/**
* getAttrInvokeAccessor: generated method. Do not modify.
* @param index the index identifying the attribute
* @param attrDef the attribute
* @return the attribute value
* @throws Exception
*/
protected Object getAttrInvokeAccessor(int index, AttributeDefImpl attrDef) throws Exception {
if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
return AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].get(this);
}
return super.getAttrInvokeAccessor(index, attrDef);
}
/**
* setAttrInvokeAccessor: generated method. Do not modify.
* @param index the index identifying the attribute
* @param value the value to assign to the attribute
* @param attrDef the attribute
* @throws Exception
*/
protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {
if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);
return;
}
super.setAttrInvokeAccessor(index, value, attrDef);
}
/**
* @return the associated entity SuppliersEOImpl.
*/
public SuppliersEOImpl getSuppliersEO() {
return (SuppliersEOImpl)getAttributeInternal(SUPPLIERSEO);
}
/**
* Sets <code>value</code> as the associated entity SuppliersEOImpl.
*/
public void setSuppliersEO(SuppliersEOImpl value) {
setAttributeInternal(SUPPLIERSEO, value);
}
/**
* @param cofName key constituent
* @return a Key object based on given key constituents.
*/
public static Key createPrimaryKey(String cofName) {
return new Key(new Object[]{cofName});
}
}
|