KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.genimen.djeneric.test.strong.impl;
2
3 import com.genimen.djeneric.repository.DjExtent;
4 import com.genimen.djeneric.repository.DjQueryByExample;
5 import com.genimen.djeneric.repository.DjSession;
6 import com.genimen.djeneric.repository.exceptions.DjenericException;
7 import com.genimen.djeneric.test.strong.ProductQbe;
8 import com.genimen.djeneric.test.strong.TestException;
9
10 // Place your custom code BETWEEN the following tags
11
//<DjenericManualCode id="1">
12
//</DjenericManualCode>
13
public class ProductQbeImpl extends DjQueryByExample implements ProductQbe
14 {
15   private static boolean propidx_set = false;
16   private static int PROPIDX_ID;
17   private static int PROPIDX_PRODUCTNUMBER;
18   private static int PROPIDX_NAME;
19   private static int PROPIDX_DESCRIPTION;
20
21   protected ProductQbeImpl(DjSession session, DjExtent extent) throws DjenericException
22   {
23     super(session, extent);
24     if (!propidx_set)
25     {
26       propidx_set = true;
27       PROPIDX_ID = extent.getPropertyIndex("id");
28       PROPIDX_PRODUCTNUMBER = extent.getPropertyIndex("productNumber");
29       PROPIDX_NAME = extent.getPropertyIndex("name");
30       PROPIDX_DESCRIPTION = extent.getPropertyIndex("description");
31     }
32   }
33
34   public void setQueryOperator(String JavaDoc propertyName, String JavaDoc operator) throws TestException
35   {
36     try
37     {
38       setOperator(propertyName, operator);
39     }
40     catch (Exception JavaDoc x)
41     {
42       throw new TestException(x);
43     }
44   }
45
46   public long getId()
47   {
48     return getLong(PROPIDX_ID);
49   }
50
51   public void setId(long value) throws TestException
52   {
53     try
54     {
55       setLong(PROPIDX_ID, value);
56     }
57     catch (Exception JavaDoc x)
58     {
59       throw new TestException(x);
60     }
61   }
62
63   public int getProductNumber()
64   {
65     return getInt(PROPIDX_PRODUCTNUMBER);
66   }
67
68   public void setProductNumber(int value) throws TestException
69   {
70     try
71     {
72       setInt(PROPIDX_PRODUCTNUMBER, value);
73     }
74     catch (Exception JavaDoc x)
75     {
76       throw new TestException(x);
77     }
78   }
79
80   public String JavaDoc getName()
81   {
82     return getString(PROPIDX_NAME);
83   }
84
85   public void setName(String JavaDoc value) throws TestException
86   {
87     try
88     {
89       setString(PROPIDX_NAME, value);
90     }
91     catch (Exception JavaDoc x)
92     {
93       throw new TestException(x);
94     }
95   }
96
97   public byte[] getDescription()
98   {
99     return getBytes(PROPIDX_DESCRIPTION);
100   }
101
102   public void setDescription(byte[] value) throws TestException
103   {
104     try
105     {
106       setBytes(PROPIDX_DESCRIPTION, value);
107     }
108     catch (Exception JavaDoc x)
109     {
110       throw new TestException(x);
111     }
112   }
113
114   // Place your custom code BETWEEN the following tags
115
//<DjenericManualCode>
116
//</DjenericManualCode>
117
}
Popular Tags