Class DBModelErrorLogger

java.lang.Object
org.apache.empire.db.validation.DBModelErrorLogger
All Implemented Interfaces:
DBModelErrorHandler

public class DBModelErrorLogger extends Object implements DBModelErrorHandler
An implemtnation of the DBModelErrorHandler interface that logs all errors
  • Field Details

    • errorCount

      protected int errorCount
    • warnCount

      protected int warnCount
  • Constructor Details

    • DBModelErrorLogger

      public DBModelErrorLogger()
  • Method Details

    • getErrorCount

      public int getErrorCount()
    • getWarnCount

      public int getWarnCount()
    • logWarn

      protected void logWarn(String msg, Object... params)
    • logError

      protected void logError(String msg, Object... params)
    • itemNotFound

      public void itemNotFound(DBObject dbo)
      handle itemNotFound errors
      Specified by:
      itemNotFound in interface DBModelErrorHandler
      Parameters:
      dbo - The missing object
    • objectTypeMismatch

      public void objectTypeMismatch(DBObject object, String name, Class<?> expectedType)
      handle objectTypeMismatch errors
      Specified by:
      objectTypeMismatch in interface DBModelErrorHandler
      Parameters:
      object - the missing object
      name - the name of the object
      expectedType - the expected type
    • columnTypeMismatch

      public void columnTypeMismatch(DBColumn col, DataType type)
      handle columnTypeMismatch errors
      Specified by:
      columnTypeMismatch in interface DBModelErrorHandler
      Parameters:
      col - The affected column
    • columnSizeMismatch

      public void columnSizeMismatch(DBColumn col, int size, int scale)
      handle columnSizeMismatch errors
      Specified by:
      columnSizeMismatch in interface DBModelErrorHandler
      Parameters:
      col - The affected column
      size - Size in the database
      scale - Decimal scale in the database (only for decimal types, 0 otherwise)
    • columnNullableMismatch

      public void columnNullableMismatch(DBColumn col, boolean nullable)
      handle columnNullableMismatch errors
      Specified by:
      columnNullableMismatch in interface DBModelErrorHandler
      Parameters:
      col - The affected column
      nullable - true if the column is required in the database
    • primaryKeyColumnMissing

      public void primaryKeyColumnMissing(DBIndex primaryKey, DBColumn column)
      handle primaryKeyColumnMissing errors
      Specified by:
      primaryKeyColumnMissing in interface DBModelErrorHandler
      Parameters:
      primaryKey - The primary key that misses the column
      column - The missing column
    • primaryKeyMismatch

      public void primaryKeyMismatch(DBIndex primaryKey, DBColumn[] tableKey)
      Description copied from interface: DBModelErrorHandler
      This method is called when the primary key of the Empire-db definition does not match the primary key of the existing table
      Specified by:
      primaryKeyMismatch in interface DBModelErrorHandler
      Parameters:
      primaryKey - The index key
      tableKey - The referenced table key