View Javadoc

    1   package org.apache.turbine.services.security.torque.om.map;
    2
    3   import java.util.Date;
    4   import java.math.BigDecimal;
    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  import org.apache.torque.map.ColumnMap;
    12  import org.apache.torque.map.InheritanceMap;
    13
    14  /**
    15    *  This class was autogenerated by Torque on:
    16    *
    17    * [Thu Jun 23 17:25:46 CEST 2011]
    18    *
    19    */
    20  public class TurbineGroupMapBuilder implements MapBuilder
    21  {
    22      /**
    23       * The name of this class
    24       */
    25      public static final String CLASS_NAME =
    26          "org.apache.turbine.services.security.torque.om.map.TurbineGroupMapBuilder";
    27
    28      /**
    29       * The database map.
    30       */
    31      private DatabaseMap dbMap = null;
    32
    33      /**
    34       * Tells us if this DatabaseMapBuilder is built so that we
    35       * don't have to re-build it every time.
    36       *
    37       * @return true if this DatabaseMapBuilder is built
    38       */
    39      public boolean isBuilt()
    40      {
    41          return (dbMap != null);
    42      }
    43
    44      /**
    45       * Gets the databasemap this map builder built.
    46       *
    47       * @return the databasemap
    48       */
    49      public DatabaseMap getDatabaseMap()
    50      {
    51          return this.dbMap;
    52      }
    53
    54      /**
    55       * The doBuild() method builds the DatabaseMap
    56       *
    57       * @throws TorqueException
    58       */
    59      public synchronized void doBuild() throws TorqueException
    60      {
    61          if ( isBuilt() ) {
    62              return;
    63          }
    64          dbMap = Torque.getDatabaseMap("default");
    65
    66          dbMap.addTable("TURBINE_GROUP");
    67          TableMap tMap = dbMap.getTable("TURBINE_GROUP");
    68          tMap.setJavaName("TurbineGroup");
    69          tMap.setOMClass( org.apache.turbine.services.security.torque.om.TurbineGroup.class );
    70          tMap.setPeerClass( org.apache.turbine.services.security.torque.om.TurbineGroupPeer.class );
    71          tMap.setPrimaryKeyMethod(TableMap.ID_BROKER);
    72          tMap.setPrimaryKeyMethodInfo(tMap.getName());
    73
    74          ColumnMap cMap = null;
    75
    76
    77    // ------------- Column: GROUP_ID --------------------
    78          cMap = new ColumnMap( "GROUP_ID", tMap);
    79          cMap.setType( new Integer(0) );
    80          cMap.setTorqueType( "INTEGER" );
    81          cMap.setUsePrimitive(true);
    82          cMap.setPrimaryKey(true);
    83          cMap.setNotNull(true);
    84          cMap.setJavaName( "GroupId" );
    85          cMap.setAutoIncrement(false);
    86          cMap.setProtected(false);
    87          cMap.setInheritance("false");
    88          cMap.setPosition(1);
    89          tMap.addColumn(cMap);
    90    // ------------- Column: GROUP_NAME --------------------
    91          cMap = new ColumnMap( "GROUP_NAME", tMap);
    92          cMap.setType( "" );
    93          cMap.setTorqueType( "VARCHAR" );
    94          cMap.setUsePrimitive(true);
    95          cMap.setPrimaryKey(false);
    96          cMap.setNotNull(true);
    97          cMap.setJavaName( "Name" );
    98          cMap.setAutoIncrement(false);
    99          cMap.setProtected(false);
    100         cMap.setInheritance("false");
    101         cMap.setSize( 64 );
    102         cMap.setPosition(2);
    103         tMap.addColumn(cMap);
    104         tMap.setUseInheritance(false);
    105     }
    106 }