Search in sources :

Example 1 with DfPropertySettingTableNotFoundException

use of org.dbflute.exception.DfPropertySettingTableNotFoundException in project dbflute-core by dbflute.

the class DfAdditionalPrimaryKeyInitializer method assertTable.

protected void assertTable(final String primaryKeyName, final String tableName) {
    if (getTable(tableName) != null) {
        return;
    }
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("Not found table by the tableName of additionalPrimaryKey.");
    br.addItem("Additional PK");
    br.addElement(primaryKeyName);
    br.addItem("NotFound Table");
    br.addElement(tableName);
    final String msg = br.buildExceptionMessage();
    throw new DfPropertySettingTableNotFoundException(msg);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfPropertySettingTableNotFoundException(org.dbflute.exception.DfPropertySettingTableNotFoundException)

Example 2 with DfPropertySettingTableNotFoundException

use of org.dbflute.exception.DfPropertySettingTableNotFoundException in project dbflute-core by dbflute.

the class DfAdditionalForeignKeyInitializer method assertLocalTable.

protected void assertLocalTable(final String foreignKeyName, final String localTableName) {
    if (getTable(localTableName) != null) {
        return;
    }
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("Not found table by the localTableName of additionalForeignKey.");
    br.addItem("Advice");
    br.addElement("Make sure your additionalForeignKeyMap.dfprop");
    br.addElement("For example:");
    br.addElement("  (x):");
    br.addElement("     ; FK_MEMBER_MEMBER_ADDRESS_VALID = map:{");
    br.addElement("         ; localTableName = NOEXISTING_STATUS ; foreignTableName = ... // *NG");
    br.addElement("         ; localColumnName = MEMBER_ID ; foreignColumnName = MEMBER_ID");
    br.addElement("         ...");
    br.addElement("     }");
    br.addElement("  (o):");
    br.addElement("     ; FK_MEMBER_MEMBER_ADDRESS_VALID = map:{");
    br.addElement("         ; localTableName = MEMBER_STATUS ; foreignTableName = ...     // OK");
    br.addElement("         ; localColumnName = MEMBER_ID ; foreignColumnName = MEMBER_ID");
    br.addElement("         ...");
    br.addElement("     }");
    br.addElement("");
    br.addElement("Or remove it if the table is deleted from your schema.");
    br.addItem("Additional FK");
    br.addElement(foreignKeyName);
    br.addItem("NotFound Table");
    br.addElement(localTableName);
    final String msg = br.buildExceptionMessage();
    throw new DfPropertySettingTableNotFoundException(msg);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfPropertySettingTableNotFoundException(org.dbflute.exception.DfPropertySettingTableNotFoundException)

Example 3 with DfPropertySettingTableNotFoundException

use of org.dbflute.exception.DfPropertySettingTableNotFoundException in project dbflute-core by dbflute.

the class DfAdditionalUniqueKeyInitializer method assertTable.

protected void assertTable(final String primaryKeyName, final String tableName) {
    if (getTable(tableName) != null) {
        return;
    }
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("Not found table by the tableName of additionalUniqueKey.");
    br.addItem("Additional UQ");
    br.addElement(primaryKeyName);
    br.addItem("NotFound Table");
    br.addElement(tableName);
    final String msg = br.buildExceptionMessage();
    throw new DfPropertySettingTableNotFoundException(msg);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfPropertySettingTableNotFoundException(org.dbflute.exception.DfPropertySettingTableNotFoundException)

Example 4 with DfPropertySettingTableNotFoundException

use of org.dbflute.exception.DfPropertySettingTableNotFoundException in project dbflute-core by dbflute.

the class DfSequenceHandlerJdbc method findTableInfo.

protected DfTableMeta findTableInfo(Connection conn, String tableName) throws SQLException {
    final DfTableMeta table = _tableMap.get(tableName);
    if (table == null) {
        String msg = "Failed to find the table in generated target tables:";
        msg = msg + " table=" + tableName + " target=" + _tableMap.keySet();
        throw new DfPropertySettingTableNotFoundException(msg);
    }
    return table;
}
Also used : DfPropertySettingTableNotFoundException(org.dbflute.exception.DfPropertySettingTableNotFoundException) DfTableMeta(org.dbflute.logic.jdbc.metadata.info.DfTableMeta)

Example 5 with DfPropertySettingTableNotFoundException

use of org.dbflute.exception.DfPropertySettingTableNotFoundException in project dbflute-core by dbflute.

the class DfRepsSequenceHandlerJdbc method findTableInfo.

protected DfTableMeta findTableInfo(Connection conn, String tableName) throws SQLException {
    final DfTableMeta table = _tableMap.get(tableName);
    if (table == null) {
        String msg = "Failed to find the table in generated target tables:";
        msg = msg + " table=" + tableName + " target=" + _tableMap.keySet();
        throw new DfPropertySettingTableNotFoundException(msg);
    }
    return table;
}
Also used : DfPropertySettingTableNotFoundException(org.dbflute.exception.DfPropertySettingTableNotFoundException) DfTableMeta(org.dbflute.logic.jdbc.metadata.info.DfTableMeta)

Aggregations

DfPropertySettingTableNotFoundException (org.dbflute.exception.DfPropertySettingTableNotFoundException)6 ExceptionMessageBuilder (org.dbflute.helper.message.ExceptionMessageBuilder)4 DfTableMeta (org.dbflute.logic.jdbc.metadata.info.DfTableMeta)2