1 package org.paneris.jammyjoes.model;
2
3 import java.sql.ResultSet;
4
5 import org.melati.poem.Database;
6 import org.melati.poem.DefinitionSource;
7 import org.melati.poem.PoemException;
8 import org.paneris.jammyjoes.model.generated.OrderTypeTableBase;
9
10 /**
11 * Melati POEM generated, programmer modifiable stub
12 * for a <code>OrderTypeTable</code> object.
13 * <p>
14 * Description:
15 * Order Type.
16 * </p>
17 *
18 *
19 * <table>
20 * <tr><th colspan='3'>
21 * Field summary for SQL table <code>OrderType</code>
22 * </th></tr>
23 * <tr><th>Name</th><th>Type</th><th>Description</th></tr>
24 * <tr><td> id </td><td> Integer </td><td> </td></tr>
25 * <tr><td> type </td><td> String </td><td> </td></tr>
26 * </table>
27 *
28 * @generator org.melati.poem.prepro.TableDef#generateTableMainJava
29 */
30 public class OrderTypeTable extends OrderTypeTableBase {
31
32 private OrderType _onlineOrder, _telephoneOrder;
33
34 /**
35 * Constructor.
36 *
37 * @generator org.melati.poem.prepro.TableDef#generateTableMainJava
38 * @param database the POEM database we are using
39 * @param name the name of this <code>Table</code>
40 * @param definitionSource which definition is being used
41 * @throws PoemException if anything goes wrong
42 */
43
44
45 public OrderTypeTable(
46 Database database, String name,
47 DefinitionSource definitionSource) throws PoemException {
48 super(database, name, definitionSource);
49 _onlineOrder = (OrderType)newPersistent();
50 _onlineOrder.setType_unsafe("Online Order");
51 _telephoneOrder = (OrderType)newPersistent();
52 _telephoneOrder.setType_unsafe("Telephone Order");
53
54 }
55
56
57 public synchronized void unifyWithDB(ResultSet colDescs)
58 throws PoemException {
59 super.unifyWithDB(colDescs);
60 _onlineOrder = (OrderType)getTypeColumn().ensure(_onlineOrder);
61 _telephoneOrder = (OrderType)getTypeColumn().ensure(_telephoneOrder);
62 }
63
64 public OrderType getOnlineOrder() {
65 return _onlineOrder;
66 }
67
68 public OrderType getTelephoneOrder() {
69 return _telephoneOrder;
70 }
71 }