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;
|
if (tables.contains(elemClass)) return;
|
||||||
try {
|
try {
|
||||||
tables.add(elemClass);
|
tables.add(elemClass);
|
||||||
//Log.info("Start Init SQL table "+elemClass.getSimpleName());
|
Log.info("[ORM] Start Init SQL table "+elemClass.getSimpleName());
|
||||||
E instance = elemClass.newInstance();
|
E instance = elemClass.newInstance();
|
||||||
String tableName = instance.tableName();
|
String tableName = instance.tableName();
|
||||||
if (!tableExist(tableName)) createTable(instance);
|
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) {
|
} catch (Exception|ExceptionInInitializerError e) {
|
||||||
throw new ORMInitTableException(elemClass, 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);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
if (!fkEl.equals(fkF.getSQLElementType()))
|
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))
|
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;
|
sqlPrimaryKeyField = fkF;
|
||||||
sqlForeignKeyElemClass = fkEl;
|
sqlForeignKeyElemClass = fkEl;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user