View Javadoc

1   package olr.om.map;
2   
3   import org.apache.torque.Torque;
4   import org.apache.torque.TorqueException;
5   import org.apache.torque.map.DatabaseMap;
6   import org.apache.torque.map.MapBuilder;
7   import org.apache.torque.map.TableMap;
8   
9   /***
10    *  This class was autogenerated by Torque on:
11    *
12    * [Tue Jul 13 14:47:47 CEST 2004]
13    *
14    */
15  public class ModelMapBuilder implements MapBuilder
16  {
17      /***
18       * The name of this class
19       */
20      public static final String CLASS_NAME =
21          "olr.om.map.ModelMapBuilder";
22  
23  
24      /***
25       * The database map.
26       */
27      private DatabaseMap dbMap = null;
28  
29      /***
30       * Tells us if this DatabaseMapBuilder is built so that we
31       * don't have to re-build it every time.
32       *
33       * @return true if this DatabaseMapBuilder is built
34       */
35      public boolean isBuilt()
36      {
37          return (dbMap != null);
38      }
39  
40      /***
41       * Gets the databasemap this map builder built.
42       *
43       * @return the databasemap
44       */
45      public DatabaseMap getDatabaseMap()
46      {
47          return this.dbMap;
48      }
49  
50      /***
51       * The doBuild() method builds the DatabaseMap
52       *
53       * @throws TorqueException
54       */
55      public void doBuild() throws TorqueException
56      {
57          dbMap = Torque.getDatabaseMap("default");
58  
59          dbMap.addTable("model");
60          TableMap tMap = dbMap.getTable("model");
61  
62          tMap.setPrimaryKeyMethod(TableMap.ID_BROKER);
63  
64          tMap.setPrimaryKeyMethodInfo(tMap.getName());
65  
66                tMap.addPrimaryKey("model.ID", new Integer(0));
67                      tMap.addColumn("model.NAME", new String());
68                      tMap.addColumn("model.LOCKED", new Long(0));
69                      tMap.addForeignKey(
70                  "model.LOCKED_BY", new Integer(0) , "rdf_user" ,
71                  "id");
72                      tMap.addColumn("model.IS_COURSE", new Integer(0));
73            }
74  }