HHH-16578 - Minor change to the column information extraction
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
parent
9dad4c44bb
commit
be9692765c
|
@ -675,7 +675,7 @@ public abstract class AbstractInformationExtractorImpl implements InformationExt
|
|||
tableInformation,
|
||||
DatabaseIdentifier.toIdentifier( resultSet.getString( getResultSetColumnNameLabel() ) ),
|
||||
resultSet.getInt( getResultSetSqlTypeCodeLabel() ),
|
||||
new StringTokenizer( resultSet.getString( getResultSetTypeNameLabel() ), "() " ).nextToken(),
|
||||
new StringTokenizer( resultSet.getString( getResultSetTypeNameLabel() ), "()" ).nextToken(),
|
||||
resultSet.getInt( getResultSetColumnSizeLabel() ),
|
||||
resultSet.getInt( getResultSetDecimalDigitsLabel() ),
|
||||
interpretTruthValue( resultSet.getString( getResultSetIsNullableLabel() ) )
|
||||
|
|
|
@ -136,7 +136,7 @@ public class InformationExtractorJdbcDatabaseMetaDataImpl extends AbstractInform
|
|||
protected void addColumns(TableInformation tableInformation) {
|
||||
final ExtractionContext extractionContext = getExtractionContext();
|
||||
// We use this dummy query to retrieve the table information through the ResultSetMetaData
|
||||
// This is significantly better than to use the DatabaseMetaData especially on Oracle with synonyms enable
|
||||
// This is significantly better than to use the DatabaseMetaData especially on Oracle with synonyms enabled
|
||||
final String tableName = extractionContext.getSqlStringGenerationContext().format(
|
||||
// The name comes from the database, so the case is correct
|
||||
// But we quote here to avoid issues with reserved words
|
||||
|
@ -157,7 +157,7 @@ public class InformationExtractorJdbcDatabaseMetaDataImpl extends AbstractInform
|
|||
tableInformation,
|
||||
DatabaseIdentifier.toIdentifier( columnName ),
|
||||
metaData.getColumnType( i ),
|
||||
new StringTokenizer( metaData.getColumnTypeName( i ), "() " ).nextToken(),
|
||||
new StringTokenizer( metaData.getColumnTypeName( i ), "()" ).nextToken(),
|
||||
metaData.getPrecision( i ),
|
||||
metaData.getScale( i ),
|
||||
interpretNullable( metaData.isNullable( i ) )
|
||||
|
|
|
@ -255,7 +255,7 @@ public class IndividuallySchemaValidatorImplTest extends BaseUnitTestCase {
|
|||
if ( metadata.getDatabase().getDialect().getVersion().isSameOrAfter( 2 ) ) {
|
||||
// Reports "character varying" since 2.0
|
||||
assertEquals(
|
||||
"Schema-validation: wrong column type encountered in column [name] in table [SomeSchema.ColumnEntity]; found [character (Types#VARCHAR)], but expecting [integer (Types#INTEGER)]",
|
||||
"Schema-validation: wrong column type encountered in column [name] in table [SomeSchema.ColumnEntity]; found [character varying (Types#VARCHAR)], but expecting [integer (Types#INTEGER)]",
|
||||
e.getMessage()
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue