1
2
3 package org.paneris.jammyjoes.model.generated;
4
5 import org.melati.poem.AccessPoemException;
6 import org.melati.poem.Column;
7 import org.melati.poem.Database;
8 import org.melati.poem.DefinitionSource;
9 import org.melati.poem.DisplayLevel;
10 import org.melati.poem.Field;
11 import org.melati.poem.JdbcPersistent;
12 import org.melati.poem.Persistent;
13 import org.melati.poem.PoemException;
14 import org.melati.poem.Searchability;
15 import org.melati.poem.StringPoemType;
16 import org.melati.poem.TroidPoemType;
17 import org.melati.poem.ValidationPoemException;
18 import org.paneris.jammyjoes.model.EcentiveCategory;
19 import org.paneris.jammyjoes.model.JammyjoesDatabaseTables;
20 import org.paneris.jammyjoes.model.JammyjoesTable;
21
22
23 /**
24 * Melati POEM generated base class for
25 <code>Table</code> <code>EcentiveCategory</code>.
26 *
27 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
28 */
29
30 public class EcentiveCategoryTableBase extends JammyjoesTable {
31
32 private Column col_id = null;
33 private Column col_category = null;
34
35 /**
36 * Constructor.
37 *
38 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
39 * @param database the POEM database we are using
40 * @param name the name of this <code>Table</code>
41 * @param definitionSource which definition is being used
42 * @throws PoemException if anything goes wrong
43 */
44
45 public EcentiveCategoryTableBase(
46 Database database, String name,
47 DefinitionSource definitionSource) throws PoemException {
48 super(database, name, definitionSource);
49 }
50
51
52 /**
53 * Get the database tables.
54 *
55 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
56 * @return the database tables
57 */
58 public JammyjoesDatabaseTables getJammyjoesDatabaseTables() {
59 return (JammyjoesDatabaseTables)getDatabase();
60 }
61
62 public void init() throws PoemException {
63 super.init();
64 defineColumn(col_id =
65 new Column(this, "id",
66 new TroidPoemType(),
67 DefinitionSource.dsd) {
68 public Object getCooked(Persistent g)
69 throws AccessPoemException, PoemException {
70 return ((EcentiveCategory)g).getId();
71 }
72
73 public void setCooked(Persistent g, Object cooked)
74 throws AccessPoemException, ValidationPoemException {
75 ((EcentiveCategory)g).setId((Integer)cooked);
76 }
77
78 public Field asField(Persistent g) {
79 return ((EcentiveCategory)g).getIdField();
80 }
81
82 protected boolean defaultUserEditable() {
83 return false;
84 }
85
86 protected boolean defaultUserCreateable() {
87 return false;
88 }
89
90 protected DisplayLevel defaultDisplayLevel() {
91 return DisplayLevel.summary;
92 }
93
94 protected int defaultDisplayOrder() {
95 return 0;
96 }
97
98 public Object getRaw_unsafe(Persistent g)
99 throws AccessPoemException {
100 return ((EcentiveCategory)g).getId_unsafe();
101 }
102
103 public void setRaw_unsafe(Persistent g, Object raw)
104 throws AccessPoemException {
105 ((EcentiveCategory)g).setId_unsafe((Integer)raw);
106 }
107
108 public Object getRaw(Persistent g)
109 throws AccessPoemException {
110 return ((EcentiveCategory)g).getId();
111 }
112
113 public void setRaw(Persistent g, Object raw)
114 throws AccessPoemException {
115 ((EcentiveCategory)g).setId((Integer)raw);
116 }
117 });
118
119 defineColumn(col_category =
120 new Column(this, "category",
121 new StringPoemType(false, -1),
122 DefinitionSource.dsd) {
123 public Object getCooked(Persistent g)
124 throws AccessPoemException, PoemException {
125 return ((EcentiveCategory)g).getCategory();
126 }
127
128 public void setCooked(Persistent g, Object cooked)
129 throws AccessPoemException, ValidationPoemException {
130 ((EcentiveCategory)g).setCategory((String)cooked);
131 }
132
133 public Field asField(Persistent g) {
134 return ((EcentiveCategory)g).getCategoryField();
135 }
136
137 protected DisplayLevel defaultDisplayLevel() {
138 return DisplayLevel.primary;
139 }
140
141 protected Searchability defaultSearchability() {
142 return Searchability.primary;
143 }
144
145 protected Integer defaultDisplayOrderPriority() {
146 return new Integer(0);
147 }
148
149 protected String defaultDisplayName() {
150 return "Category";
151 }
152
153 protected int defaultDisplayOrder() {
154 return 1;
155 }
156
157 protected String defaultDescription() {
158 return "The E-centives category";
159 }
160
161 protected boolean defaultUnique() {
162 return true;
163 }
164
165 protected int defaultWidth() {
166 return 30;
167 }
168
169 public Object getRaw_unsafe(Persistent g)
170 throws AccessPoemException {
171 return ((EcentiveCategory)g).getCategory_unsafe();
172 }
173
174 public void setRaw_unsafe(Persistent g, Object raw)
175 throws AccessPoemException {
176 ((EcentiveCategory)g).setCategory_unsafe((String)raw);
177 }
178
179 public Object getRaw(Persistent g)
180 throws AccessPoemException {
181 return ((EcentiveCategory)g).getCategory();
182 }
183
184 public void setRaw(Persistent g, Object raw)
185 throws AccessPoemException {
186 ((EcentiveCategory)g).setCategory((String)raw);
187 }
188 });
189 }
190
191
192 /**
193 * Retrieves the <code>Id</code> <code>Column</code> for this
194 * <code>EcentiveCategory</code> <code>Table</code>.
195 *
196 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
197 * @return the id <code>Column</code>
198 */
199 public final Column getIdColumn() {
200 return col_id;
201 }
202
203
204 /**
205 * Retrieves the <code>Category</code> <code>Column</code> for this
206 * <code>EcentiveCategory</code> <code>Table</code>.
207 *
208 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
209 * @return the category <code>Column</code>
210 */
211 public final Column getCategoryColumn() {
212 return col_category;
213 }
214
215
216 /**
217 * Retrieve the <code>EcentiveCategory</code> as a <code>EcentiveCategory</code>.
218 *
219 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
220 * @param troid a Table Row Oject ID
221 * @return the <code>Persistent</code> identified by the <code>troid</code>
222 */
223 public EcentiveCategory getEcentiveCategoryObject(Integer troid) {
224 return (EcentiveCategory)getObject(troid);
225 }
226
227
228 /**
229 * Retrieve the <code>EcentiveCategory</code>
230 * as a <code>EcentiveCategory</code>.
231 *
232 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
233 * @param troid a Table Row Object ID
234 * @return the <code>Persistent</code> identified */
235 public EcentiveCategory getEcentiveCategoryObject(int troid) {
236 return (EcentiveCategory)getObject(troid);
237 }
238
239 protected JdbcPersistent _newPersistent() {
240 return new EcentiveCategory();
241 }
242 protected String defaultDisplayName() {
243 return "E-centives Category";
244 }
245
246 protected String defaultDescription() {
247 return "E-centives category for this product";
248 }
249
250 protected String defaultCategory() {
251 return "Codes";
252 }
253
254 protected int defaultDisplayOrder() {
255 return 1065;
256 }
257 }
258