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 TurbineUserGroupRoleMapBuilder 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.TurbineUserGroupRoleMapBuilder";
    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_USER_GROUP_ROLE");
    67          TableMap tMap = dbMap.getTable("TURBINE_USER_GROUP_ROLE");
    68          tMap.setJavaName("TurbineUserGroupRole");
    69          tMap.setOMClass( org.apache.turbine.services.security.torque.om.TurbineUserGroupRole.class );
    70          tMap.setPeerClass( org.apache.turbine.services.security.torque.om.TurbineUserGroupRolePeer.class );
    71          tMap.setPrimaryKeyMethod("none");
    72
    73          ColumnMap cMap = null;
    74
    75
    76    // ------------- Column: USER_ID --------------------
    77          cMap = new ColumnMap( "USER_ID", tMap);
    78          cMap.setType( new Integer(0) );
    79          cMap.setTorqueType( "INTEGER" );
    80          cMap.setUsePrimitive(true);
    81          cMap.setPrimaryKey(true);
    82          cMap.setNotNull(true);
    83          cMap.setJavaName( "UserId" );
    84          cMap.setAutoIncrement(false);
    85          cMap.setProtected(false);
    86          cMap.setInheritance("false");
    87          cMap.setForeignKey("TURBINE_USER", "USER_ID");
    88          cMap.setPosition(1);
    89          tMap.addColumn(cMap);
    90    // ------------- Column: GROUP_ID --------------------
    91          cMap = new ColumnMap( "GROUP_ID", tMap);
    92          cMap.setType( new Integer(0) );
    93          cMap.setTorqueType( "INTEGER" );
    94          cMap.setUsePrimitive(true);
    95          cMap.setPrimaryKey(true);
    96          cMap.setNotNull(true);
    97          cMap.setJavaName( "GroupId" );
    98          cMap.setAutoIncrement(false);
    99          cMap.setProtected(false);
    100         cMap.setInheritance("false");
    101         cMap.setForeignKey("TURBINE_GROUP", "GROUP_ID");
    102         cMap.setPosition(2);
    103         tMap.addColumn(cMap);
    104   // ------------- Column: ROLE_ID --------------------
    105         cMap = new ColumnMap( "ROLE_ID", tMap);
    106         cMap.setType( new Integer(0) );
    107         cMap.setTorqueType( "INTEGER" );
    108         cMap.setUsePrimitive(true);
    109         cMap.setPrimaryKey(true);
    110         cMap.setNotNull(true);
    111         cMap.setJavaName( "RoleId" );
    112         cMap.setAutoIncrement(false);
    113         cMap.setProtected(false);
    114         cMap.setInheritance("false");
    115         cMap.setForeignKey("TURBINE_ROLE", "ROLE_ID");
    116         cMap.setPosition(3);
    117         tMap.addColumn(cMap);
    118         tMap.setUseInheritance(false);
    119     }
    120 }