Skip to content

Commit a8ffff6

Browse files
committed
HHH-16578 - Minor change to the column information extraction
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
1 parent bbcb6cc commit a8ffff6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/AbstractInformationExtractorImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ protected void addExtractedColumnInformation(TableInformation tableInformation,
675675
tableInformation,
676676
DatabaseIdentifier.toIdentifier( resultSet.getString( getResultSetColumnNameLabel() ) ),
677677
resultSet.getInt( getResultSetSqlTypeCodeLabel() ),
678-
new StringTokenizer( resultSet.getString( getResultSetTypeNameLabel() ), "() " ).nextToken(),
678+
new StringTokenizer( resultSet.getString( getResultSetTypeNameLabel() ), "()" ).nextToken(),
679679
resultSet.getInt( getResultSetColumnSizeLabel() ),
680680
resultSet.getInt( getResultSetDecimalDigitsLabel() ),
681681
interpretTruthValue( resultSet.getString( getResultSetIsNullableLabel() ) )

hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/InformationExtractorJdbcDatabaseMetaDataImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ protected <T> T processImportedKeysResultSet(
136136
protected void addColumns(TableInformation tableInformation) {
137137
final ExtractionContext extractionContext = getExtractionContext();
138138
// We use this dummy query to retrieve the table information through the ResultSetMetaData
139-
// This is significantly better than to use the DatabaseMetaData especially on Oracle with synonyms enable
139+
// This is significantly better than to use the DatabaseMetaData especially on Oracle with synonyms enabled
140140
final String tableName = extractionContext.getSqlStringGenerationContext().format(
141141
// The name comes from the database, so the case is correct
142142
// But we quote here to avoid issues with reserved words
@@ -157,7 +157,7 @@ protected void addColumns(TableInformation tableInformation) {
157157
tableInformation,
158158
DatabaseIdentifier.toIdentifier( columnName ),
159159
metaData.getColumnType( i ),
160-
new StringTokenizer( metaData.getColumnTypeName( i ), "() " ).nextToken(),
160+
new StringTokenizer( metaData.getColumnTypeName( i ), "()" ).nextToken(),
161161
metaData.getPrecision( i ),
162162
metaData.getScale( i ),
163163
interpretNullable( metaData.isNullable( i ) )

hibernate-core/src/test/java/org/hibernate/orm/test/tool/schema/IndividuallySchemaValidatorImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public void testMismatchColumnType() {
255255
if ( metadata.getDatabase().getDialect().getVersion().isSameOrAfter( 2 ) ) {
256256
// Reports "character varying" since 2.0
257257
assertEquals(
258-
"Schema-validation: wrong column type encountered in column [name] in table [SomeSchema.ColumnEntity]; found [character (Types#VARCHAR)], but expecting [integer (Types#INTEGER)]",
258+
"Schema-validation: wrong column type encountered in column [name] in table [SomeSchema.ColumnEntity]; found [character varying (Types#VARCHAR)], but expecting [integer (Types#INTEGER)]",
259259
e.getMessage()
260260
);
261261
}

0 commit comments

Comments
 (0)