super(message);
}
- public ColumnSchemaNotFoundException(final String message, final Throwable cause) {
- super(message, cause);
+ public ColumnSchemaNotFoundException(final String columnName, final String tableName) {
+ this("Unable to locate ColumnSchema for " + columnName + " in " + tableName);
}
- public static String createMessage(final String columnName, final String tableName) {
- return "Unable to locate ColumnSchema for " + columnName + " in " + tableName;
+ public ColumnSchemaNotFoundException(final String message, final Throwable cause) {
+ super(message, cause);
}
}
super(message);
}
- public TableSchemaNotFoundException(final String message, final Throwable cause) {
- super(message, cause);
+ public TableSchemaNotFoundException(final String tableName, final String schemaName) {
+ this("Unable to locate TableSchema for " + tableName + " in " + schemaName);
}
- public static String createMessage(final String tableName, final String schemaName) {
- return "Unable to locate TableSchema for " + tableName + " in " + schemaName;
+ public TableSchemaNotFoundException(final String message, final Throwable cause) {
+ super(message, cause);
}
}
}
GenericTableSchema tableSchema = TyperUtils.getTableSchema(dbSchema, target);
if (tableSchema == null) {
- String message = TableSchemaNotFoundException.createMessage(TypedReflections.getTableName(target),
- dbSchema.getName());
- throw new TableSchemaNotFoundException(message);
+ throw new TableSchemaNotFoundException(TypedReflections.getTableName(target), dbSchema.getName());
}
ColumnSchema<GenericTableSchema, Object> columnSchema =
TyperUtils.getColumnSchema(tableSchema, columnName, (Class<Object>) method.getReturnType());
if (columnSchema == null) {
- String message = ColumnSchemaNotFoundException.createMessage(columnName, tableSchema.getName());
- throw new ColumnSchemaNotFoundException(message);
+ throw new ColumnSchemaNotFoundException(columnName, tableSchema.getName());
}
if (row == null || row.getColumn(columnSchema) == null) {
return null;
}
GenericTableSchema tableSchema = TyperUtils.getTableSchema(dbSchema, target);
if (tableSchema == null) {
- String message = TableSchemaNotFoundException.createMessage(TypedReflections.getTableName(target),
- dbSchema.getName());
- throw new TableSchemaNotFoundException(message);
+ throw new TableSchemaNotFoundException(TypedReflections.getTableName(target), dbSchema.getName());
}
ColumnSchema<GenericTableSchema, Object> columnSchema =
TyperUtils.getColumnSchema(tableSchema, columnName, (Class<Object>) method.getReturnType());
if (columnSchema == null) {
- String message = ColumnSchemaNotFoundException.createMessage(columnName, tableSchema.getName());
- throw new ColumnSchemaNotFoundException(message);
+ throw new ColumnSchemaNotFoundException(columnName, tableSchema.getName());
}
// When the row is null, that might indicate that the user maybe interested
// only in the ColumnSchema and not on the Data.