Package org.apache.torque.map

Examples of org.apache.torque.map.TableMap


            return;
        }
        dbMap = Torque.getDatabaseMap("default");

        dbMap.addTable("TURBINE_USER");
        TableMap tMap = dbMap.getTable("TURBINE_USER");
        tMap.setJavaName("TurbineUser");
        tMap.setOMClass( org.apache.turbine.services.security.torque.om.TurbineUser.class );
        tMap.setPeerClass( org.apache.turbine.services.security.torque.om.TurbineUserPeer.class );
        tMap.setPrimaryKeyMethod(TableMap.ID_BROKER);
        tMap.setPrimaryKeyMethodInfo(tMap.getName());

        ColumnMap cMap = null;


  // ------------- Column: USER_ID --------------------
        cMap = new ColumnMap( "USER_ID", tMap);
        cMap.setType( new Integer(0) );
        cMap.setTorqueType( "INTEGER" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(true);
        cMap.setNotNull(true);
        cMap.setJavaName( "UserId" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setPosition(1);
        tMap.addColumn(cMap);
  // ------------- Column: LOGIN_NAME --------------------
        cMap = new ColumnMap( "LOGIN_NAME", tMap);
        cMap.setType( "" );
        cMap.setTorqueType( "VARCHAR" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(true);
        cMap.setJavaName( "UserName" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setSize( 64 );
        cMap.setPosition(2);
        tMap.addColumn(cMap);
  // ------------- Column: PASSWORD_VALUE --------------------
        cMap = new ColumnMap( "PASSWORD_VALUE", tMap);
        cMap.setType( "" );
        cMap.setTorqueType( "VARCHAR" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(true);
        cMap.setJavaName( "Password" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setSize( 16 );
        cMap.setPosition(3);
        tMap.addColumn(cMap);
  // ------------- Column: FIRST_NAME --------------------
        cMap = new ColumnMap( "FIRST_NAME", tMap);
        cMap.setType( "" );
        cMap.setTorqueType( "VARCHAR" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(true);
        cMap.setJavaName( "FirstName" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setSize( 64 );
        cMap.setPosition(4);
        tMap.addColumn(cMap);
  // ------------- Column: LAST_NAME --------------------
        cMap = new ColumnMap( "LAST_NAME", tMap);
        cMap.setType( "" );
        cMap.setTorqueType( "VARCHAR" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(true);
        cMap.setJavaName( "LastName" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setSize( 64 );
        cMap.setPosition(5);
        tMap.addColumn(cMap);
  // ------------- Column: EMAIL --------------------
        cMap = new ColumnMap( "EMAIL", tMap);
        cMap.setType( "" );
        cMap.setTorqueType( "VARCHAR" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(false);
        cMap.setJavaName( "Email" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setSize( 64 );
        cMap.setPosition(6);
        tMap.addColumn(cMap);
  // ------------- Column: CONFIRM_VALUE --------------------
        cMap = new ColumnMap( "CONFIRM_VALUE", tMap);
        cMap.setType( "" );
        cMap.setTorqueType( "VARCHAR" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(false);
        cMap.setJavaName( "Confirmed" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setSize( 16 );
        cMap.setPosition(7);
        tMap.addColumn(cMap);
  // ------------- Column: MODIFIED --------------------
        cMap = new ColumnMap( "MODIFIED", tMap);
        cMap.setType( new Date() );
        cMap.setTorqueType( "TIMESTAMP" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(false);
        cMap.setJavaName( "Modified" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setPosition(8);
        tMap.addColumn(cMap);
  // ------------- Column: CREATED --------------------
        cMap = new ColumnMap( "CREATED", tMap);
        cMap.setType( new Date() );
        cMap.setTorqueType( "TIMESTAMP" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(false);
        cMap.setJavaName( "CreateDate" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setPosition(9);
        tMap.addColumn(cMap);
  // ------------- Column: LAST_LOGIN --------------------
        cMap = new ColumnMap( "LAST_LOGIN", tMap);
        cMap.setType( new Date() );
        cMap.setTorqueType( "TIMESTAMP" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(false);
        cMap.setJavaName( "LastLogin" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setPosition(10);
        tMap.addColumn(cMap);
  // ------------- Column: OBJECTDATA --------------------
        cMap = new ColumnMap( "OBJECTDATA", tMap);
        cMap.setType( new Object() );
        cMap.setTorqueType( "VARBINARY" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(false);
        cMap.setJavaName( "Objectdata" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setPosition(11);
        tMap.addColumn(cMap);
        tMap.setUseInheritance(false);
    }
View Full Code Here


            return;
        }
        dbMap = Torque.getDatabaseMap("default");

        dbMap.addTable("TURBINE_ROLE");
        TableMap tMap = dbMap.getTable("TURBINE_ROLE");
        tMap.setJavaName("TurbineRole");
        tMap.setOMClass( org.apache.turbine.services.security.torque.om.TurbineRole.class );
        tMap.setPeerClass( org.apache.turbine.services.security.torque.om.TurbineRolePeer.class );
        tMap.setPrimaryKeyMethod(TableMap.ID_BROKER);
        tMap.setPrimaryKeyMethodInfo(tMap.getName());

        ColumnMap cMap = null;


  // ------------- Column: ROLE_ID --------------------
        cMap = new ColumnMap( "ROLE_ID", tMap);
        cMap.setType( new Integer(0) );
        cMap.setTorqueType( "INTEGER" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(true);
        cMap.setNotNull(true);
        cMap.setJavaName( "RoleId" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setPosition(1);
        tMap.addColumn(cMap);
  // ------------- Column: ROLE_NAME --------------------
        cMap = new ColumnMap( "ROLE_NAME", tMap);
        cMap.setType( "" );
        cMap.setTorqueType( "VARCHAR" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(true);
        cMap.setJavaName( "Name" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setSize( 64 );
        cMap.setPosition(2);
        tMap.addColumn(cMap);
        tMap.setUseInheritance(false);
    }
View Full Code Here

            return;
        }
        dbMap = Torque.getDatabaseMap("default");

        dbMap.addTable("TURBINE_USER_GROUP_ROLE");
        TableMap tMap = dbMap.getTable("TURBINE_USER_GROUP_ROLE");
        tMap.setJavaName("TurbineUserGroupRole");
        tMap.setOMClass( org.apache.turbine.services.security.torque.om.TurbineUserGroupRole.class );
        tMap.setPeerClass( org.apache.turbine.services.security.torque.om.TurbineUserGroupRolePeer.class );
        tMap.setPrimaryKeyMethod("none");

        ColumnMap cMap = null;


  // ------------- Column: USER_ID --------------------
        cMap = new ColumnMap( "USER_ID", tMap);
        cMap.setType( new Integer(0) );
        cMap.setTorqueType( "INTEGER" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(true);
        cMap.setNotNull(true);
        cMap.setJavaName( "UserId" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setForeignKey("TURBINE_USER", "USER_ID");
        cMap.setPosition(1);
        tMap.addColumn(cMap);
  // ------------- Column: GROUP_ID --------------------
        cMap = new ColumnMap( "GROUP_ID", tMap);
        cMap.setType( new Integer(0) );
        cMap.setTorqueType( "INTEGER" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(true);
        cMap.setNotNull(true);
        cMap.setJavaName( "GroupId" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setForeignKey("TURBINE_GROUP", "GROUP_ID");
        cMap.setPosition(2);
        tMap.addColumn(cMap);
  // ------------- Column: ROLE_ID --------------------
        cMap = new ColumnMap( "ROLE_ID", tMap);
        cMap.setType( new Integer(0) );
        cMap.setTorqueType( "INTEGER" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(true);
        cMap.setNotNull(true);
        cMap.setJavaName( "RoleId" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setForeignKey("TURBINE_ROLE", "ROLE_ID");
        cMap.setPosition(3);
        tMap.addColumn(cMap);
        tMap.setUseInheritance(false);
    }
View Full Code Here

            return;
        }
        dbMap = Torque.getDatabaseMap("default");

        dbMap.addTable("TURBINE_GROUP");
        TableMap tMap = dbMap.getTable("TURBINE_GROUP");
        tMap.setJavaName("TurbineGroup");
        tMap.setOMClass( org.apache.turbine.services.security.torque.om.TurbineGroup.class );
        tMap.setPeerClass( org.apache.turbine.services.security.torque.om.TurbineGroupPeer.class );
        tMap.setPrimaryKeyMethod(TableMap.ID_BROKER);
        tMap.setPrimaryKeyMethodInfo(tMap.getName());

        ColumnMap cMap = null;


  // ------------- Column: GROUP_ID --------------------
        cMap = new ColumnMap( "GROUP_ID", tMap);
        cMap.setType( new Integer(0) );
        cMap.setTorqueType( "INTEGER" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(true);
        cMap.setNotNull(true);
        cMap.setJavaName( "GroupId" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setPosition(1);
        tMap.addColumn(cMap);
  // ------------- Column: GROUP_NAME --------------------
        cMap = new ColumnMap( "GROUP_NAME", tMap);
        cMap.setType( "" );
        cMap.setTorqueType( "VARCHAR" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(true);
        cMap.setJavaName( "Name" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setSize( 64 );
        cMap.setPosition(2);
        tMap.addColumn(cMap);
        tMap.setUseInheritance(false);
    }
View Full Code Here

            return;
        }
        dbMap = Torque.getDatabaseMap("default");

        dbMap.addTable("TURBINE_PERMISSION");
        TableMap tMap = dbMap.getTable("TURBINE_PERMISSION");
        tMap.setJavaName("TurbinePermission");
        tMap.setOMClass( org.apache.turbine.services.security.torque.om.TurbinePermission.class );
        tMap.setPeerClass( org.apache.turbine.services.security.torque.om.TurbinePermissionPeer.class );
        tMap.setPrimaryKeyMethod(TableMap.ID_BROKER);
        tMap.setPrimaryKeyMethodInfo(tMap.getName());

        ColumnMap cMap = null;


  // ------------- Column: PERMISSION_ID --------------------
        cMap = new ColumnMap( "PERMISSION_ID", tMap);
        cMap.setType( new Integer(0) );
        cMap.setTorqueType( "INTEGER" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(true);
        cMap.setNotNull(true);
        cMap.setJavaName( "PermissionId" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setPosition(1);
        tMap.addColumn(cMap);
  // ------------- Column: PERMISSION_NAME --------------------
        cMap = new ColumnMap( "PERMISSION_NAME", tMap);
        cMap.setType( "" );
        cMap.setTorqueType( "VARCHAR" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(true);
        cMap.setJavaName( "Name" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setSize( 64 );
        cMap.setPosition(2);
        tMap.addColumn(cMap);
        tMap.setUseInheritance(false);
    }
View Full Code Here

            return;
        }
        dbMap = Torque.getDatabaseMap("default");

        dbMap.addTable("TURBINE_SCHEDULED_JOB");
        TableMap tMap = dbMap.getTable("TURBINE_SCHEDULED_JOB");
        tMap.setJavaName("JobEntry");
        tMap.setOMClass( org.apache.turbine.services.schedule.JobEntry.class );
        tMap.setPeerClass( org.apache.turbine.services.schedule.JobEntryPeer.class );
        tMap.setPrimaryKeyMethod(TableMap.ID_BROKER);
        tMap.setPrimaryKeyMethodInfo(tMap.getName());

        ColumnMap cMap = null;


  // ------------- Column: JOB_ID --------------------
        cMap = new ColumnMap( "JOB_ID", tMap);
        cMap.setType( new Integer(0) );
        cMap.setTorqueType( "INTEGER" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(true);
        cMap.setNotNull(true);
        cMap.setJavaName( "JobId" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setPosition(1);
        tMap.addColumn(cMap);
  // ------------- Column: SECOND --------------------
        cMap = new ColumnMap( "SECOND", tMap);
        cMap.setType( new Integer(0) );
        cMap.setTorqueType( "INTEGER" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(true);
        cMap.setJavaName( "Second" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setDefault("-1");
        cMap.setInheritance("false");
        cMap.setPosition(2);
        tMap.addColumn(cMap);
  // ------------- Column: MINUTE --------------------
        cMap = new ColumnMap( "MINUTE", tMap);
        cMap.setType( new Integer(0) );
        cMap.setTorqueType( "INTEGER" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(true);
        cMap.setJavaName( "Minute" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setDefault("-1");
        cMap.setInheritance("false");
        cMap.setPosition(3);
        tMap.addColumn(cMap);
  // ------------- Column: HOUR --------------------
        cMap = new ColumnMap( "HOUR", tMap);
        cMap.setType( new Integer(0) );
        cMap.setTorqueType( "INTEGER" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(true);
        cMap.setJavaName( "Hour" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setDefault("-1");
        cMap.setInheritance("false");
        cMap.setPosition(4);
        tMap.addColumn(cMap);
  // ------------- Column: WEEK_DAY --------------------
        cMap = new ColumnMap( "WEEK_DAY", tMap);
        cMap.setType( new Integer(0) );
        cMap.setTorqueType( "INTEGER" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(true);
        cMap.setJavaName( "WeekDay" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setDefault("-1");
        cMap.setInheritance("false");
        cMap.setPosition(5);
        tMap.addColumn(cMap);
  // ------------- Column: DAY_OF_MONTH --------------------
        cMap = new ColumnMap( "DAY_OF_MONTH", tMap);
        cMap.setType( new Integer(0) );
        cMap.setTorqueType( "INTEGER" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(true);
        cMap.setJavaName( "DayOfMonth" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setDefault("-1");
        cMap.setInheritance("false");
        cMap.setPosition(6);
        tMap.addColumn(cMap);
  // ------------- Column: TASK --------------------
        cMap = new ColumnMap( "TASK", tMap);
        cMap.setType( "" );
        cMap.setTorqueType( "VARCHAR" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(true);
        cMap.setJavaName( "Task" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setSize( 99 );
        cMap.setPosition(7);
        tMap.addColumn(cMap);
  // ------------- Column: EMAIL --------------------
        cMap = new ColumnMap( "EMAIL", tMap);
        cMap.setType( "" );
        cMap.setTorqueType( "VARCHAR" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(false);
        cMap.setJavaName( "Email" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setSize( 99 );
        cMap.setPosition(8);
        tMap.addColumn(cMap);
  // ------------- Column: PROPERTY --------------------
        cMap = new ColumnMap( "PROPERTY", tMap);
        cMap.setType( new Object() );
        cMap.setTorqueType( "VARBINARY" );
        cMap.setUsePrimitive(true);
        cMap.setPrimaryKey(false);
        cMap.setNotNull(false);
        cMap.setJavaName( "Property" );
        cMap.setAutoIncrement(false);
        cMap.setProtected(false);
        cMap.setInheritance("false");
        cMap.setPosition(9);
        tMap.addColumn(cMap);
        tMap.setUseInheritance(false);
    }
View Full Code Here

     * @param map the DataBaseMap to setup.
     */
    private final void setupIdTable(DatabaseMap map)
    {
        map.setIdTable("ID_TABLE");
        TableMap tMap = map.getIdTable();
        tMap.addPrimaryKey("ID_TABLE_ID", new Integer(0));
        tMap.addColumn("TABLE_NAME", "");
        tMap.addColumn("NEXT_ID", new Integer(0));
        tMap.addColumn("QUANTITY", new Integer(0));
    }
View Full Code Here

            throw new TorqueException("Database insert attempted without "
                    + "anything specified to insert");
        }

        DatabaseMap dbMap = Torque.getDatabaseMap(criteria.getDbName());
        TableMap tableMap = dbMap.getTable(tableName);
        Object keyInfo = tableMap.getPrimaryKeyMethodInfo();
        IdGenerator keyGen = tableMap.getIdGenerator();

        ColumnMap pk = getPrimaryKey(criteria);

        // pk will be null if there is no primary key defined for the table
        // we're inserting into.
View Full Code Here

        }

        String dbName = criteria.getDbName();
        Database database = Torque.getDatabase(dbName);
        DatabaseMap dbMap = database.getDatabaseMap();
        TableMap tableMap = dbMap.getTable(table);
        Object keyInfo = tableMap.getPrimaryKeyMethodInfo();
        IdGenerator keyGen
                = database.getIdGenerator(tableMap.getPrimaryKeyMethod());

        ColumnMap pk = getPrimaryKey(criteria);

        // If the keyMethod is SEQUENCE or IDBROKERTABLE, get the id
        // before the insert.
View Full Code Here

        Iterator keyIt = criteria.keySet().iterator();
        while (keyIt.hasNext())
        {
            String key = (String) keyIt.next();
            String columnName;
            TableMap tableMap = null;
            int dotPosition = key.lastIndexOf(".");
            if (dotPosition == -1)
            {
                columnName = key;
                tableMap = defaultTableMap;
            }
            else
            {
                columnName = key.substring(dotPosition + 1);
                String tableName = key.substring(0, dotPosition);
                String databaseName = criteria.getDbName();
                if (databaseName == null)
                {
                    databaseName = Torque.getDefaultDB();
                }
                DatabaseMap databaseMap = Torque.getDatabaseMap(databaseName);
                if (databaseMap != null)
                {
                    tableMap = databaseMap.getTable(tableName);
                }
                if (tableMap == null)
                {
                    // try aliases
                    Map aliases = criteria.getAliases();
                    if (aliases.get(tableName) != null)
                    {
                        tableName = (String) aliases.get(tableName);
                        tableMap = databaseMap.getTable(tableName);
                    }
                }
            }
            if (tableMap == null)
            {
                // no description of table available, do not modify anything
                continue;
            }

            ColumnMap columnMap = tableMap.getColumn(columnName);
            if (columnMap != null)
            {
                if ("BOOLEANINT".equals(columnMap.getTorqueType()))
                {
                    Criteria.Criterion criterion = criteria.getCriterion(key);
View Full Code Here

TOP

Related Classes of org.apache.torque.map.TableMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.