Add debug infos in ORM table initialisation
This commit is contained in:
parent
a6f126bcc7
commit
a956f5143e
@ -41,11 +41,11 @@ public final class ORM {
|
||||
if (tables.contains(elemClass)) return;
|
||||
try {
|
||||
tables.add(elemClass);
|
||||
//Log.info("Start Init SQL table "+elemClass.getSimpleName());
|
||||
Log.info("[ORM] Start Init SQL table "+elemClass.getSimpleName());
|
||||
E instance = elemClass.newInstance();
|
||||
String tableName = instance.tableName();
|
||||
if (!tableExist(tableName)) createTable(instance);
|
||||
//Log.info("End init SQL table "+elemClass.getSimpleName());
|
||||
Log.info("[ORM] End init SQL table "+elemClass.getSimpleName());
|
||||
} catch (Exception|ExceptionInInitializerError e) {
|
||||
throw new ORMInitTableException(elemClass, e);
|
||||
}
|
||||
|
@ -52,9 +52,9 @@ public class SQLFKField<F extends SQLElement<F>, T, P extends SQLElement<P>> ext
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (!fkEl.equals(fkF.getSQLElementType()))
|
||||
throw new IllegalArgumentException("foreignKeyField must be from supplied foreignKeyElement");
|
||||
throw new IllegalArgumentException("foreignKeyField (" + fkF.getSQLElementType().getName() + ") must be from supplied foreignKeyElement (" + fkEl.getName() + ")");
|
||||
if (!type.equals(fkF.type))
|
||||
throw new IllegalArgumentException("foreignKeyField and current Field must have the same SQLType");
|
||||
throw new IllegalArgumentException("foreignKeyField (" + fkF.type.sqlDeclaration + ") and current Field (" + type.sqlDeclaration + ") must have the same SQLType");
|
||||
sqlPrimaryKeyField = fkF;
|
||||
sqlForeignKeyElemClass = fkEl;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user