Package org.apache.ddlutils.model

Examples of org.apache.ddlutils.model.Table.findColumn()


     * {@inheritDoc}
     */
    public void apply(Database database, boolean caseSensitive)
    {
        Table  table  = database.findTable(getChangedTable().getName(), caseSensitive);
        Column column = table.findColumn(_column.getName(), caseSensitive);

        column.setSizeAndScale(_newSize, _newScale);
    }
}
View Full Code Here


        printIndent();
        print("COLUMN ");
        printIdentifier(getColumnName(change.getChangedColumn()));

        Table   curTable   = currentModel.findTable(change.getChangedTable().getName(), getPlatform().isDelimitedIdentifierModeOn());
        Column  curColumn  = curTable.findColumn(change.getChangedColumn().getName(), getPlatform().isDelimitedIdentifierModeOn());
        boolean hasDefault = curColumn.getParsedDefaultValue() != null;

        if (isValidDefaultValue(change.getNewDefaultValue(), curColumn.getTypeCode()))
        {
            if (hasDefault)
View Full Code Here

        printIndent();
        print("REPLACE ");
        printIdentifier(getColumnName(change.getChangedColumn()));

        Table  curTable  = currentModel.findTable(change.getChangedTable().getName(), getPlatform().isDelimitedIdentifierModeOn());
        Column curColumn = curTable.findColumn(change.getChangedColumn().getName(), getPlatform().isDelimitedIdentifierModeOn());

        print(" DEFAULT ");
        if (isValidDefaultValue(change.getNewDefaultValue(), curColumn.getTypeCode()))
        {
            printDefaultValue(change.getNewDefaultValue(), curColumn.getTypeCode());
View Full Code Here

            Collection primaryKeys = readPrimaryKeyNames(metaData, tableName);

            for (Iterator it = primaryKeys.iterator(); it.hasNext();)
            {
                table.findColumn((String)it.next(), true).setPrimaryKey(true);
            }

            if (getPlatformInfo().isSystemIndicesReturned())
            {
                removeSystemIndices(metaData, table);
View Full Code Here

            Column prevColumn = change.getPreviousColumn();

            if (prevColumn != null)
            {
                // we need the corresponding column object from the current table
                prevColumn = curTable.findColumn(prevColumn.getName(), getPlatform().isDelimitedIdentifierModeOn());
            }
            // Even though Interbase can only add columns, we can move them later on
            print("ALTER TABLE ");
            printlnIdentifier(getTableName(change.getChangedTable()));
            printIndent();
View Full Code Here

            String propName = columnName;

            if (table != null)
            {
                Column column = table.findColumn(columnName, _caseSensitive);

                if (column != null)
                {
                    propName = column.getName();
                }
View Full Code Here

  }

    private void modifyVarBinaryColumn(Database targetModel, String tableName, String columnName)
    {
        Table table = targetModel.findTable(tableName);
        Column c = table.findColumn(columnName);
        c.setType("VARCHAR");       
        c.setSize("2000");
        System.out.println("updating column " + c.getName() + " for table " + table.getName());
    }
  /**
 
View Full Code Here

  }

    private void modifyVarBinaryColumn(Database targetModel, String tableName, String columnName)
    {
        Table table = targetModel.findTable(tableName);
        Column c = table.findColumn(columnName);
        c.setType("VARCHAR");       
        c.setSize("2000");
        System.out.println("updating column " + c.getName() + " for table " + table.getName());
    }
  /**
 
View Full Code Here

            table.addColumns(readColumns(metaData, tableName));

            Collection<String> primaryKeys = readPrimaryKeyNames(metaData, tableName);

            for (Object key : primaryKeys) {
                Column col = table.findColumn((String) key, true);

                if (col != null) {
                    col.setPrimaryKey(true);
                } else {
                    throw new NullPointerException(
View Full Code Here

                _elementToRequiredAttributesMap.put(elementName, requiredAttributes);
            }
            for (Iterator columnIt = columns.iterator(); columnIt.hasNext();)
            {
                String columnName = (String)columnIt.next();
                Column column     = mappedTable.findColumn(columnName);

                if (column != null)
                {
                    columnsMap.put(columnName, column);
                    requiredAttributes.put(columnName, Boolean.TRUE);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.