01: package org.tigris.scarab.om.map;
02:
03: import java.util.Date;
04: import java.math.BigDecimal;
05:
06: import org.apache.torque.Torque;
07: import org.apache.torque.TorqueException;
08: import org.apache.torque.map.MapBuilder;
09: import org.apache.torque.map.DatabaseMap;
10: import org.apache.torque.map.TableMap;
11:
12: /**
13: */
14: public class PendingGroupUserRoleMapBuilder implements MapBuilder {
15: /**
16: * The name of this class
17: */
18: public static final String CLASS_NAME = "org.tigris.scarab.om.map.PendingGroupUserRoleMapBuilder";
19:
20: /**
21: * The database map.
22: */
23: private DatabaseMap dbMap = null;
24:
25: /**
26: * Tells us if this DatabaseMapBuilder is built so that we
27: * don't have to re-build it every time.
28: *
29: * @return true if this DatabaseMapBuilder is built
30: */
31: public boolean isBuilt() {
32: return (dbMap != null);
33: }
34:
35: /**
36: * Gets the databasemap this map builder built.
37: *
38: * @return the databasemap
39: */
40: public DatabaseMap getDatabaseMap() {
41: return this .dbMap;
42: }
43:
44: /**
45: * The doBuild() method builds the DatabaseMap
46: *
47: * @throws TorqueException
48: */
49: public void doBuild() throws TorqueException {
50: dbMap = Torque.getDatabaseMap("scarab");
51:
52: dbMap.addTable("SCARAB_PENDING_GROUP_USER_ROLE");
53: TableMap tMap = dbMap
54: .getTable("SCARAB_PENDING_GROUP_USER_ROLE");
55:
56: tMap.setPrimaryKeyMethod("none");
57:
58: tMap.addForeignPrimaryKey(
59: "SCARAB_PENDING_GROUP_USER_ROLE.USER_ID",
60: new Integer(0), "TURBINE_USER", "USER_ID");
61: tMap.addForeignPrimaryKey(
62: "SCARAB_PENDING_GROUP_USER_ROLE.GROUP_ID", new Integer(
63: 0), "SCARAB_MODULE", "MODULE_ID");
64: tMap.addPrimaryKey("SCARAB_PENDING_GROUP_USER_ROLE.ROLE_NAME",
65: "");
66: }
67: }
|