    001    package org.apache.turbine.services.security.torque.om.map;
    002
    003    import java.util.Date;
    004    import java.math.BigDecimal;
    005
    006    import org.apache.torque.Torque;
    007    import org.apache.torque.TorqueException;
    008    import org.apache.torque.map.MapBuilder;
    009    import org.apache.torque.map.DatabaseMap;
    010    import org.apache.torque.map.TableMap;
    011    import org.apache.torque.map.ColumnMap;
    012    import org.apache.torque.map.InheritanceMap;
    013
    014    /**
    015      *  This class was autogenerated by Torque on:
    016      *
    017      * [Thu Jun 23 17:25:46 CEST 2011]
    018      *
    019      */
    020    public class TurbineUserGroupRoleMapBuilder implements MapBuilder
    021    {
    022        /**
    023         * The name of this class
    024         */
    025        public static final String CLASS_NAME =
    026            "org.apache.turbine.services.security.torque.om.map.TurbineUserGroupRoleMapBuilder";
    027
    028        /**
    029         * The database map.
    030         */
    031        private DatabaseMap dbMap = null;
    032
    033        /**
    034         * Tells us if this DatabaseMapBuilder is built so that we
    035         * don't have to re-build it every time.
    036         *
    037         * @return true if this DatabaseMapBuilder is built
    038         */
    039        public boolean isBuilt()
    040        {
    041            return (dbMap != null);
    042        }
    043
    044        /**
    045         * Gets the databasemap this map builder built.
    046         *
    047         * @return the databasemap
    048         */
    049        public DatabaseMap getDatabaseMap()
    050        {
    051            return this.dbMap;
    052        }
    053
    054        /**
    055         * The doBuild() method builds the DatabaseMap
    056         *
    057         * @throws TorqueException
    058         */
    059        public synchronized void doBuild() throws TorqueException
    060        {
    061            if ( isBuilt() ) {
    062                return;
    063            }
    064            dbMap = Torque.getDatabaseMap("default");
    065
    066            dbMap.addTable("TURBINE_USER_GROUP_ROLE");
    067            TableMap tMap = dbMap.getTable("TURBINE_USER_GROUP_ROLE");
    068            tMap.setJavaName("TurbineUserGroupRole");
    069            tMap.setOMClass( org.apache.turbine.services.security.torque.om.TurbineUserGroupRole.class );
    070            tMap.setPeerClass( org.apache.turbine.services.security.torque.om.TurbineUserGroupRolePeer.class );
    071            tMap.setPrimaryKeyMethod("none");
    072
    073            ColumnMap cMap = null;
    074
    075
    076      // ------------- Column: USER_ID --------------------
    077            cMap = new ColumnMap( "USER_ID", tMap);
    078            cMap.setType( new Integer(0) );
    079            cMap.setTorqueType( "INTEGER" );
    080            cMap.setUsePrimitive(true);
    081            cMap.setPrimaryKey(true);
    082            cMap.setNotNull(true);
    083            cMap.setJavaName( "UserId" );
    084            cMap.setAutoIncrement(false);
    085            cMap.setProtected(false);
    086            cMap.setInheritance("false");
    087            cMap.setForeignKey("TURBINE_USER", "USER_ID");
    088            cMap.setPosition(1);
    089            tMap.addColumn(cMap);
    090      // ------------- Column: GROUP_ID --------------------
    091            cMap = new ColumnMap( "GROUP_ID", tMap);
    092            cMap.setType( new Integer(0) );
    093            cMap.setTorqueType( "INTEGER" );
    094            cMap.setUsePrimitive(true);
    095            cMap.setPrimaryKey(true);
    096            cMap.setNotNull(true);
    097            cMap.setJavaName( "GroupId" );
    098            cMap.setAutoIncrement(false);
    099            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    }