public class DBModelErrorLogger extends Object implements DBModelErrorHandler
DBModelErrorHandler
interface that logs all errorsModifier and Type | Field and Description |
---|---|
protected int |
errorCount |
protected int |
warnCount |
Constructor and Description |
---|
DBModelErrorLogger() |
Modifier and Type | Method and Description |
---|---|
void |
columnNullableMismatch(DBColumn col,
boolean nullable)
handle columnNullableMismatch errors
|
void |
columnSizeMismatch(DBColumn col,
int size,
int scale)
handle columnSizeMismatch errors
|
void |
columnTypeMismatch(DBColumn col,
DataType type)
handle columnTypeMismatch errors
|
int |
getErrorCount() |
int |
getWarnCount() |
void |
itemNotFound(DBObject dbo)
handle itemNotFound errors
|
protected void |
logError(String msg,
Object... params) |
protected void |
logWarn(String msg,
Object... params) |
void |
objectTypeMismatch(DBObject object,
String name,
Class<?> expectedType)
handle objectTypeMismatch errors
|
void |
primaryKeyColumnMissing(DBIndex primaryKey,
DBColumn column)
handle primaryKeyColumnMissing errors
|
void |
primaryKeyMismatch(DBIndex primaryKey,
DBColumn[] tableKey)
This method is called when the primary key of the Empire-db definition
does not match the primary key of the existing table
|
public int getErrorCount()
public int getWarnCount()
public void itemNotFound(DBObject dbo)
itemNotFound
in interface DBModelErrorHandler
dbo
- The missing objectpublic void objectTypeMismatch(DBObject object, String name, Class<?> expectedType)
objectTypeMismatch
in interface DBModelErrorHandler
object
- the missing objectname
- the name of the objectexpectedType
- the expected typepublic void columnTypeMismatch(DBColumn col, DataType type)
columnTypeMismatch
in interface DBModelErrorHandler
col
- The affected columnpublic void columnSizeMismatch(DBColumn col, int size, int scale)
columnSizeMismatch
in interface DBModelErrorHandler
col
- The affected columnsize
- Size in the databasescale
- Decimal scale in the database (only for decimal types, 0 otherwise)public void columnNullableMismatch(DBColumn col, boolean nullable)
columnNullableMismatch
in interface DBModelErrorHandler
col
- The affected columnnullable
- true if the column is required in the databasepublic void primaryKeyColumnMissing(DBIndex primaryKey, DBColumn column)
primaryKeyColumnMissing
in interface DBModelErrorHandler
primaryKey
- The primary key that misses the columncolumn
- The missing columnpublic void primaryKeyMismatch(DBIndex primaryKey, DBColumn[] tableKey)
DBModelErrorHandler
primaryKeyMismatch
in interface DBModelErrorHandler
primaryKey
- The index keytableKey
- The referenced table keyCopyright © 2008–2023 Apache Software Foundation. All rights reserved.