Package oracle.toplink.essentials.internal.helper

Examples of oracle.toplink.essentials.internal.helper.DatabaseTable


    return 128;
  }

  @Override
  public final DatabaseTable getTempTableForTable(final DatabaseTable table) {
    return new DatabaseTable("$" + table.getName(), table.getTableQualifier());
  }
View Full Code Here


     * This should handle most of the direct/relational mappings except many-to-many and direct
     * collection/map mappings, witch must be down in postInit method.
     */
    protected void initTableSchema(ClassDescriptor desc) {
        TableDefinition tblDef = null;
        DatabaseTable dbTbl = null;
        Iterator dbTblIter = desc.getTables().iterator();

        //create a table definition for each mapped database table
        while (dbTblIter.hasNext()) {
            dbTbl = (DatabaseTable) dbTblIter.next();
View Full Code Here

            fkField = resolveDatabaseField(fkField, targetField);
            setFieldToRelationTable(fkField, tblDef);
        }
       
        // add a foreign key constraint from fk field to target field
        DatabaseTable targetTable = targetField.getTable();
        TableDefinition targetTblDef = getTableDefFromDBTable(targetTable);
       
        addForeignKeyConstraint(tblDef, targetTblDef, fkFieldNames, targetFieldNames);
    }
View Full Code Here

        // only if there are additional tables
        if (!desc.hasMultipleTables()) {
            return;
        }
       
        DatabaseTable dbTbl = null;
        Iterator dbTblIter = desc.getTables().iterator();
        while (dbTblIter.hasNext()) {
            dbTbl = (DatabaseTable) dbTblIter.next();
            Map<DatabaseField, DatabaseField> srcFields = desc.getAdditionalTablePrimaryKeyFields().get(dbTbl);
            if ((null != srcFields) && srcFields.size() > 0) {
View Full Code Here

    public void setTable(DatabaseTable table) {
        this.table = table;
    }
   
    public void setTableName(String name) {
        table = new DatabaseTable(name);
    }
View Full Code Here

               
            }
        }

        // add a foreign key constraint
        DatabaseTable sourceTable = fkField.getTable();
        DatabaseTable targetTable = targetField.getTable();
        TableDefinition sourceTableDef = getTableDefFromDBTable(sourceTable);
        TableDefinition targetTableDef = getTableDefFromDBTable(targetTable);
       
        addForeignKeyConstraint(sourceTableDef, targetTableDef, fkFieldNames, targetFieldNames);
    }
View Full Code Here

            while(itEntries.hasNext()) {
                writeForAll(writer, firstMainPrimaryKey);
                writer.write(trpltab);
                writer.write("UPDATE ");
                Map.Entry entry = (Map.Entry)itEntries.next();
                DatabaseTable t = (DatabaseTable)entry.getKey();
                writer.write(t.getQualifiedName());
                writer.write(" SET ");
                HashMap databaseFieldsToValues = (HashMap)entry.getValue();
                int counter = 0;
                Iterator itDatabaseFields = databaseFieldsToValues.keySet().iterator();
                while(itDatabaseFields.hasNext()) {
View Full Code Here

        // Make sure that the table is fully qualified.
        if ((!sourceField.hasTableName()) || (!targetField.hasTableName())) {
            throw DescriptorException.multipleTablePrimaryKeyMustBeFullyQualified(this);
        }
       
        DatabaseTable sourceTable = sourceField.getTable();
        DatabaseTable targetTable = targetField.getTable();
        setAdditionalTablePrimaryKeyFields(targetTable, sourceField, targetField);
       
        if (isForeignKey) {
            getMultipleTableForeignKeys().put(sourceTable, targetTable);
        }
View Full Code Here

     * Specify the table name for the class of objects the receiver describes.
     * If the table has a qualifier it should be specified using the dot notation,
     * (i.e. "userid.employee"). This method is used if there is more than one table.
     */
    public void addTableName(String tableName) {
        addTable(new DatabaseTable(tableName));
    }
View Full Code Here

    // * added 9/7/00 by Les Davis
    // * bug fix for null pointer in initialization of mappings in remote session
    public DatabaseField buildField(String fieldName) {
        DatabaseField field = new DatabaseField(fieldName);
        DatabaseTable table;

        if (field.hasTableName()) {
            table = getTable(field.getTableName());
        } else if (getDefaultTable() != null) {
            table = getDefaultTable();
View Full Code Here

TOP

Related Classes of oracle.toplink.essentials.internal.helper.DatabaseTable

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.