Search in sources :

Example 1 with DfColumnDiff

use of org.dbflute.logic.jdbc.schemadiff.DfColumnDiff in project dbflute-core by dbflute.

the class DfFirstDateAgent method getColumnFirstDateMap.

protected Map<String, Date> getColumnFirstDateMap() {
    // case insensitive (not flexible because of historical changes)
    if (_columnFirstDateMap != null) {
        return _columnFirstDateMap;
    }
    final Map<String, Date> columnFirstDateMap = StringKeyMap.createAsCaseInsensitiveOrdered();
    final List<DfSchemaDiff> schemaDiffList = prepareSchemaDiffList();
    for (DfSchemaDiff schemaDiff : schemaDiffList) {
        final List<DfTableDiff> tableDiffList = schemaDiff.getChangedTableDiffList();
        for (DfTableDiff tableDiff : tableDiffList) {
            final String tableName = tableDiff.getTableName();
            final List<DfColumnDiff> columnDiffList = tableDiff.getAddedColumnDiffList();
            for (DfColumnDiff columnDiff : columnDiffList) {
                final String columnName = columnDiff.getColumnName();
                final String keyName = generateColumnKey(tableName, columnName);
                columnFirstDateMap.put(keyName, schemaDiff.getNativeDiffDate());
            }
        }
    }
    _columnFirstDateMap = columnFirstDateMap;
    return _columnFirstDateMap;
}
Also used : DfSchemaDiff(org.dbflute.logic.jdbc.schemadiff.DfSchemaDiff) DfTableDiff(org.dbflute.logic.jdbc.schemadiff.DfTableDiff) DfColumnDiff(org.dbflute.logic.jdbc.schemadiff.DfColumnDiff) Date(java.util.Date) HandyDate(org.dbflute.helper.HandyDate)

Aggregations

Date (java.util.Date)1 HandyDate (org.dbflute.helper.HandyDate)1 DfColumnDiff (org.dbflute.logic.jdbc.schemadiff.DfColumnDiff)1 DfSchemaDiff (org.dbflute.logic.jdbc.schemadiff.DfSchemaDiff)1 DfTableDiff (org.dbflute.logic.jdbc.schemadiff.DfTableDiff)1