Search in sources :

Example 1 with DfTableDiff

use of org.dbflute.logic.jdbc.schemadiff.DfTableDiff 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)

Example 2 with DfTableDiff

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

the class DfFirstDateAgent method getTableFirstDateMap.

protected Map<String, Date> getTableFirstDateMap() {
    // case insensitive (not flexible because of historical changes)
    if (_tableFirstDateMap != null) {
        return _tableFirstDateMap;
    }
    final Map<String, Date> tableFirstDateMap = StringKeyMap.createAsCaseInsensitiveOrdered();
    final List<DfSchemaDiff> schemaDiffList = prepareSchemaDiffList();
    for (DfSchemaDiff schemaDiff : schemaDiffList) {
        List<DfTableDiff> tableDiffList = schemaDiff.getAddedTableDiffList();
        for (DfTableDiff tableDiff : tableDiffList) {
            final String tableName = tableDiff.getTableName();
            tableFirstDateMap.put(tableName, schemaDiff.getNativeDiffDate());
        }
    }
    _tableFirstDateMap = tableFirstDateMap;
    return _tableFirstDateMap;
}
Also used : DfSchemaDiff(org.dbflute.logic.jdbc.schemadiff.DfSchemaDiff) DfTableDiff(org.dbflute.logic.jdbc.schemadiff.DfTableDiff) Date(java.util.Date) HandyDate(org.dbflute.helper.HandyDate)

Aggregations

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