KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > campware > cream > om > map > SorderMapBuilder


1 package org.campware.cream.om.map;
2
3 import java.util.Date JavaDoc;
4 import java.math.BigDecimal JavaDoc;
5
6 import org.apache.torque.Torque;
7 import org.apache.torque.TorqueException;
8 import org.apache.torque.map.MapBuilder;
9 import org.apache.torque.map.DatabaseMap;
10 import org.apache.torque.map.TableMap;
11
12 /**
13   * This class was autogenerated by Torque on:
14   *
15   * [Wed May 04 09:10:56 CEST 2005]
16   *
17   */

18 public class SorderMapBuilder implements MapBuilder
19 {
20     /**
21      * The name of this class
22      */

23     public static final String JavaDoc CLASS_NAME =
24         "org.campware.cream.om.map.SorderMapBuilder";
25
26
27     /**
28      * The database map.
29      */

30     private DatabaseMap dbMap = null;
31
32     /**
33      * Tells us if this DatabaseMapBuilder is built so that we
34      * don't have to re-build it every time.
35      *
36      * @return true if this DatabaseMapBuilder is built
37      */

38     public boolean isBuilt()
39     {
40         return (dbMap != null);
41     }
42
43     /**
44      * Gets the databasemap this map builder built.
45      *
46      * @return the databasemap
47      */

48     public DatabaseMap getDatabaseMap()
49     {
50         return this.dbMap;
51     }
52
53     /**
54      * The doBuild() method builds the DatabaseMap
55      *
56      * @throws TorqueException
57      */

58     public void doBuild() throws TorqueException
59     {
60         dbMap = Torque.getDatabaseMap("cream");
61
62         dbMap.addTable("SORDER");
63         TableMap tMap = dbMap.getTable("SORDER");
64
65         tMap.setPrimaryKeyMethod(TableMap.NATIVE);
66
67         tMap.setPrimaryKeyMethodInfo("SORDER_SEQ");
68
69               tMap.addPrimaryKey("SORDER.SORDER_ID", new Integer JavaDoc(0));
70                     tMap.addColumn("SORDER.SORDER_CODE", "");
71                     tMap.addColumn("SORDER.STATUS", new Integer JavaDoc(0));
72                     tMap.addColumn("SORDER.PRIORITY", new Integer JavaDoc(0));
73                     tMap.addColumn("SORDER.ISSUED_DATE", new Date JavaDoc());
74                     tMap.addColumn("SORDER.CLOSED_DATE", new Date JavaDoc());
75                     tMap.addForeignKey(
76                 "SORDER.CUSTOMER_ID", new Integer JavaDoc(0) , "CUSTOMER" ,
77                 "CUSTOMER_ID");
78                     tMap.addForeignKey(
79                 "SORDER.RECIPIENT_ID", new Integer JavaDoc(0) , "CUSTOMER" ,
80                 "CUSTOMER_ID");
81                     tMap.addForeignKey(
82                 "SORDER.PROJECT_ID", new Integer JavaDoc(0) , "PROJECT" ,
83                 "PROJECT_ID");
84                     tMap.addForeignKey(
85                 "SORDER.CARRIER_ID", new Integer JavaDoc(0) , "CARRIER" ,
86                 "CARRIER_ID");
87                     tMap.addColumn("SORDER.PAY_TERM", new Integer JavaDoc(0));
88                     tMap.addColumn("SORDER.PAY_METHOD", new Integer JavaDoc(0));
89                     tMap.addForeignKey(
90                 "SORDER.CURRENCY_ID", new Integer JavaDoc(0) , "CURRENCY" ,
91                 "CURRENCY_ID");
92                     tMap.addColumn("SORDER.CURRENCY_AMOUNT", new BigDecimal JavaDoc(0));
93                     tMap.addColumn("SORDER.SUBJECT", "");
94                     tMap.addColumn("SORDER.NOTES", "");
95                     tMap.addColumn("SORDER.CREATED", new Date JavaDoc());
96                     tMap.addColumn("SORDER.MODIFIED", new Date JavaDoc());
97                     tMap.addColumn("SORDER.CREATED_BY", "");
98                     tMap.addColumn("SORDER.MODIFIED_BY", "");
99           }
100 }
101
Popular Tags