Example usage for org.hibernate.tool.hbm2ddl ColumnMetadata getName

List of usage examples for org.hibernate.tool.hbm2ddl ColumnMetadata getName

Introduction

In this page you can find the example usage for org.hibernate.tool.hbm2ddl ColumnMetadata getName.

Prototype

public String getName() 

Source Link

Usage

From source file:corner.migration.services.impl.fragment.ChangeColumnFragment.java

License:Apache License

String sqlAlterStrings(Table table, String columnName, Dialect dialect, Mapping p, TableMetadata tableInfo,
        String defaultCatalog, String defaultSchema) throws HibernateException {

    Iterator iter = table.getColumnIterator();
    String alterSQL = null;//from www  .jav a2s. c  o  m

    while (iter.hasNext()) {
        Column column = (Column) iter.next();
        ColumnMetadata columnInfo = tableInfo.getColumnMetadata(column.getName());
        if (columnInfo != null && columnInfo.getName().toLowerCase().equals(columnName.toLowerCase())) {//,???
            alterSQL = this.getConnectionAdapter().changeColumnSQL(this.getQualifiedTableName(table),
                    getSQLType(column));
        }

    }
    return alterSQL;
}

From source file:corner.services.migration.impl.fragment.ChangeColumnFragment.java

License:Apache License

String sqlAlterStrings(Table table, String columnName, Dialect dialect, Mapping p, TableMetadata tableInfo,
        String defaultCatalog, String defaultSchema) throws HibernateException {

    Iterator iter = table.getColumnIterator();
    String alterSQL = null;/*w  w  w  .  j av a 2s.  co m*/

    while (iter.hasNext()) {
        Column column = (Column) iter.next();
        ColumnMetadata columnInfo = tableInfo.getColumnMetadata(column.getName());
        if (columnInfo != null && columnInfo.getName().toLowerCase().equals(columnName.toLowerCase())) {//,???
            alterSQL = this.getConnectionAdapter().changeColumnSQL(table.getName(), getSQLType(column));
        }

    }
    return alterSQL;
}