View Javadoc

1   package org.apache.james.mailboxmanager.torque.om.map;
2   
3   import java.util.Date;
4   
5   import org.apache.torque.Torque;
6   import org.apache.torque.TorqueException;
7   import org.apache.torque.map.DatabaseMap;
8   import org.apache.torque.map.MapBuilder;
9   import org.apache.torque.map.TableMap;
10  
11  /**
12   * This class was autogenerated by Torque on:
13   * 
14   * [Wed Sep 06 08:50:08 CEST 2006]
15   * 
16   */
17  public class MessageMapBuilder implements MapBuilder {
18      /**
19       * The name of this class
20       */
21      public static final String CLASS_NAME = "org.apache.james.mailboxmanager.torque.om.map.MessageMapBuilder";
22  
23      /**
24       * The database map.
25       */
26      private DatabaseMap dbMap = null;
27  
28      /**
29       * Tells us if this DatabaseMapBuilder is built so that we don't have to
30       * re-build it every time.
31       * 
32       * @return true if this DatabaseMapBuilder is built
33       */
34      public boolean isBuilt() {
35          return (dbMap != null);
36      }
37  
38      /**
39       * Gets the databasemap this map builder built.
40       * 
41       * @return the databasemap
42       */
43      public DatabaseMap getDatabaseMap() {
44          return this.dbMap;
45      }
46  
47      /**
48       * The doBuild() method builds the DatabaseMap
49       * 
50       * @throws TorqueException
51       */
52      public void doBuild() throws TorqueException {
53          dbMap = Torque.getDatabaseMap("mailboxmanager");
54  
55          dbMap.addTable("message");
56          TableMap tMap = dbMap.getTable("message");
57  
58          tMap.setPrimaryKeyMethod("none");
59  
60          tMap.addForeignPrimaryKey("message.MAILBOX_ID", new Long(0), "mailbox",
61                  "mailbox_id");
62          tMap.addPrimaryKey("message.UID", new Long(0));
63          tMap.addColumn("message.FLAGS", new Integer(0));
64          tMap.addColumn("message.INTERNAL_DATE", new Date());
65      }
66  }