KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > genimen > djeneric > test > strong > impl > OrderlineImpl


1 package com.genimen.djeneric.test.strong.impl;
2
3 import com.genimen.djeneric.repository.DjExtent;
4 import com.genimen.djeneric.repository.DjSession;
5 import com.genimen.djeneric.repository.exceptions.DjenericException;
6 import com.genimen.djeneric.test.strong.Order;
7 import com.genimen.djeneric.test.strong.Orderline;
8 import com.genimen.djeneric.test.strong.Product;
9 import com.genimen.djeneric.test.strong.TestException;
10
11 // Place your custom code BETWEEN the following tags
12
//<DjenericManualCode id="1">
13
//</DjenericManualCode>
14
public class OrderlineImpl extends TestObjectImpl implements Orderline
15 {
16   private static boolean propidx_set = false;
17   private static int PROPIDX_ID;
18   private static int PROPIDX_LINE;
19   private static int PROPIDX_QUANTITY;
20   private static int PROPIDX_THEORDER;
21   private static int PROPIDX_PRODUCT;
22
23   protected OrderlineImpl(DjSession session, DjExtent extent) throws DjenericException
24   {
25     super(session, extent);
26     if (!propidx_set)
27     {
28       propidx_set = true;
29       PROPIDX_ID = extent.getPropertyIndex("id");
30       PROPIDX_LINE = extent.getPropertyIndex("line");
31       PROPIDX_QUANTITY = extent.getPropertyIndex("quantity");
32       PROPIDX_THEORDER = extent.getPropertyIndex("theOrder");
33       PROPIDX_PRODUCT = extent.getPropertyIndex("product");
34     }
35   }
36
37   public long determineObjectId() throws TestException
38   {
39     try
40     {
41       return getObjectId();
42     }
43     catch (Exception JavaDoc x)
44     {
45       throw new TestException(x);
46     }
47   }
48
49   public long getId()
50   {
51     return getLong(PROPIDX_ID);
52   }
53
54   public boolean isNullId()
55   {
56     return isNull(PROPIDX_ID);
57   }
58
59   public int getLine()
60   {
61     return getInt(PROPIDX_LINE);
62   }
63
64   public boolean isNullLine()
65   {
66     return isNull(PROPIDX_LINE);
67   }
68
69   public void setLine(int value) throws TestException
70   {
71     try
72     {
73       setInt(PROPIDX_LINE, value);
74     }
75     catch (Exception JavaDoc x)
76     {
77       throw new TestException(x);
78     }
79   }
80
81   public void setNullLine() throws TestException
82   {
83     try
84     {
85       setNull(PROPIDX_LINE);
86     }
87     catch (Exception JavaDoc x)
88     {
89       throw new TestException(x);
90     }
91   }
92
93   public int getQuantity()
94   {
95     return getInt(PROPIDX_QUANTITY);
96   }
97
98   public boolean isNullQuantity()
99   {
100     return isNull(PROPIDX_QUANTITY);
101   }
102
103   public void setQuantity(int value) throws TestException
104   {
105     try
106     {
107       setInt(PROPIDX_QUANTITY, value);
108     }
109     catch (Exception JavaDoc x)
110     {
111       throw new TestException(x);
112     }
113   }
114
115   public void setNullQuantity() throws TestException
116   {
117     try
118     {
119       setNull(PROPIDX_QUANTITY);
120     }
121     catch (Exception JavaDoc x)
122     {
123       throw new TestException(x);
124     }
125   }
126
127   public Order getTheOrder() throws TestException
128   {
129     try
130     {
131       return (Order) get(PROPIDX_THEORDER);
132     }
133     catch (Exception JavaDoc x)
134     {
135       throw new TestException(x);
136     }
137   }
138
139   public boolean isNullTheOrder()
140   {
141     return isNull(PROPIDX_THEORDER);
142   }
143
144   public void setTheOrder(Order value) throws TestException
145   {
146     try
147     {
148       set(PROPIDX_THEORDER, (OrderImpl) value);
149     }
150     catch (Exception JavaDoc x)
151     {
152       throw new TestException(x);
153     }
154   }
155
156   public void setNullTheOrder() throws TestException
157   {
158     try
159     {
160       setNull(PROPIDX_THEORDER);
161     }
162     catch (Exception JavaDoc x)
163     {
164       throw new TestException(x);
165     }
166   }
167
168   public Product getProduct() throws TestException
169   {
170     try
171     {
172       return (Product) get(PROPIDX_PRODUCT);
173     }
174     catch (Exception JavaDoc x)
175     {
176       throw new TestException(x);
177     }
178   }
179
180   public boolean isNullProduct()
181   {
182     return isNull(PROPIDX_PRODUCT);
183   }
184
185   public void setProduct(Product value) throws TestException
186   {
187     try
188     {
189       set(PROPIDX_PRODUCT, (ProductImpl) value);
190     }
191     catch (Exception JavaDoc x)
192     {
193       throw new TestException(x);
194     }
195   }
196
197   public void setNullProduct() throws TestException
198   {
199     try
200     {
201       setNull(PROPIDX_PRODUCT);
202     }
203     catch (Exception JavaDoc x)
204     {
205       throw new TestException(x);
206     }
207   }
208
209   // Place your custom code BETWEEN the following tags
210
//<DjenericManualCode>
211
//</DjenericManualCode>
212
}
Popular Tags