KickJava   Java API By Example, From Geeks To Geeks.

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


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 CustomerMapBuilder 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.CustomerMapBuilder";
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("CUSTOMER");
63         TableMap tMap = dbMap.getTable("CUSTOMER");
64
65         tMap.setPrimaryKeyMethod(TableMap.NATIVE);
66
67         tMap.setPrimaryKeyMethodInfo("CUSTOMER_SEQ");
68
69               tMap.addPrimaryKey("CUSTOMER.CUSTOMER_ID", new Integer JavaDoc(0));
70                     tMap.addColumn("CUSTOMER.CUSTOMER_CODE", "");
71                     tMap.addColumn("CUSTOMER.STATUS", new Integer JavaDoc(0));
72                     tMap.addColumn("CUSTOMER.PRIORITY", new Integer JavaDoc(0));
73                     tMap.addColumn("CUSTOMER.CUSTOMER_TYPE", new Integer JavaDoc(0));
74                     tMap.addForeignKey(
75                 "CUSTOMER.CUSTOMER_CAT_ID", new Integer JavaDoc(0) , "CUSTOMER_CATEGORY" ,
76                 "CUSTOMER_CAT_ID");
77                     tMap.addColumn("CUSTOMER.CUSTOMER_NAME_1", "");
78                     tMap.addColumn("CUSTOMER.CUSTOMER_NAME_2", "");
79                     tMap.addColumn("CUSTOMER.CUSTOMER_DISPLAY", "");
80                     tMap.addColumn("CUSTOMER.DEAR", "");
81                     tMap.addColumn("CUSTOMER.ADDRESS_1", "");
82                     tMap.addColumn("CUSTOMER.ADDRESS_2", "");
83                     tMap.addColumn("CUSTOMER.CITY", "");
84                     tMap.addColumn("CUSTOMER.ZIP", "");
85                     tMap.addColumn("CUSTOMER.STATE", "");
86                     tMap.addForeignKey(
87                 "CUSTOMER.COUNTRY_ID", new Integer JavaDoc(0) , "COUNTRY" ,
88                 "COUNTRY_ID");
89                     tMap.addForeignKey(
90                 "CUSTOMER.REGION_ID", new Integer JavaDoc(0) , "REGION" ,
91                 "REGION_ID");
92                     tMap.addColumn("CUSTOMER.PHONE_1", "");
93                     tMap.addColumn("CUSTOMER.PHONE_2", "");
94                     tMap.addColumn("CUSTOMER.FAX", "");
95                     tMap.addColumn("CUSTOMER.EMAIL", "");
96                     tMap.addColumn("CUSTOMER.EMAIL_FORMAT", new Integer JavaDoc(0));
97                     tMap.addColumn("CUSTOMER.SEND_NEWS", new Integer JavaDoc(0));
98                     tMap.addColumn("CUSTOMER.WEB_URL", "");
99                     tMap.addForeignKey(
100                 "CUSTOMER.LANGUAGE_ID", new Integer JavaDoc(0) , "LANGUAGE" ,
101                 "LANGUAGE_ID");
102                     tMap.addColumn("CUSTOMER.GENDER", new Integer JavaDoc(0));
103                     tMap.addForeignKey(
104                 "CUSTOMER.EDUCATION_CAT_ID", new Integer JavaDoc(0) , "EDUCATION_CATEGORY" ,
105                 "EDUCATION_CAT_ID");
106                     tMap.addForeignKey(
107                 "CUSTOMER.HOUSEHOLD_CAT_ID", new Integer JavaDoc(0) , "HOUSEHOLD_CATEGORY" ,
108                 "HOUSEHOLD_CAT_ID");
109                     tMap.addColumn("CUSTOMER.CUSTOM_1", "");
110                     tMap.addColumn("CUSTOMER.CUSTOM_2", "");
111                     tMap.addColumn("CUSTOMER.CUSTOM_3", "");
112                     tMap.addColumn("CUSTOMER.CUSTOM_4", "");
113                     tMap.addColumn("CUSTOMER.CUSTOM_5", "");
114                     tMap.addColumn("CUSTOMER.CUSTOM_6", "");
115                     tMap.addColumn("CUSTOMER.NOTES", "");
116                     tMap.addColumn("CUSTOMER.CREATED", new Date JavaDoc());
117                     tMap.addColumn("CUSTOMER.MODIFIED", new Date JavaDoc());
118                     tMap.addColumn("CUSTOMER.CREATED_BY", "");
119                     tMap.addColumn("CUSTOMER.MODIFIED_BY", "");
120           }
121 }
122
Popular Tags