/** * Check whether the parameter of dbSchema is valid and check whether the table is existent in * Database Schema. */ private boolean isValid() { if (dbSchema == null) { return false; } if (!dbSchema.name().equalsIgnoreCase(tableDesc.database())) { return false; } checkTableSchemaVersion(); return true; }
/** * Returns ColumnSchema from TableSchema by column name. * * @param columnName column name * @return ColumnSchema */ private ColumnSchema getColumnSchema(String columnName) { TableSchema tableSchema = getTableSchema(); if (tableSchema == null) { String message = TableSchemaNotFoundException.createMessage(tableDesc.name(), dbSchema.name()); throw new TableSchemaNotFoundException(message); } ColumnSchema columnSchema = tableSchema.getColumnSchema(columnName); if (columnSchema == null) { String message = ColumnSchemaNotFoundException.createMessage(columnName, tableSchema.name()); throw new ColumnSchemaNotFoundException(message); } return columnSchema; }