Search in sources :

Example 1 with DfCustomizeEntityDuplicateException

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

the class DfOutsideSqlAnalyzer method assertDuplicateEntity.

// ===================================================================================
// Assert Definition
// =================
protected void assertDuplicateEntity(String entityName, File currentSqlFile) {
    final DfCustomizeEntityInfo entityInfo = _sql2entityMeta.getEntityInfoMap().get(entityName);
    if (entityInfo == null) {
        return;
    }
    final File sqlFile = entityInfo.getSqlFile();
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("The same-name customize-entities were found.");
    br.addItem("CustomizeEntity");
    br.addElement(entityName);
    br.addItem("SQL Files");
    br.addElement(sqlFile);
    br.addElement(currentSqlFile);
    final String msg = br.buildExceptionMessage();
    throw new DfCustomizeEntityDuplicateException(msg);
}
Also used : DfCustomizeEntityInfo(org.dbflute.logic.sql2entity.cmentity.DfCustomizeEntityInfo) ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfCustomizeEntityDuplicateException(org.dbflute.exception.DfCustomizeEntityDuplicateException) File(java.io.File)

Aggregations

File (java.io.File)1 DfCustomizeEntityDuplicateException (org.dbflute.exception.DfCustomizeEntityDuplicateException)1 ExceptionMessageBuilder (org.dbflute.helper.message.ExceptionMessageBuilder)1 DfCustomizeEntityInfo (org.dbflute.logic.sql2entity.cmentity.DfCustomizeEntityInfo)1