diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/adaptor/impl/ResultSetAdaptor.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/adaptor/impl/ResultSetAdaptor.java index c9a021a4a..0bfcd89d5 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/adaptor/impl/ResultSetAdaptor.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/adaptor/impl/ResultSetAdaptor.java @@ -1323,10 +1323,25 @@ private static class MetaData implements ResultSetMetaData { private final List columns; private final List descriptors; + private final String[] typeNames; + public MetaData(List columnNames, List columnDescriptors) { columns = columnNames; descriptors = columnDescriptors; + typeNames = initTypeNames( columnDescriptors ); + } + + private static String[] initTypeNames(List columnDescriptors) { + if ( columnDescriptors == null ) { + return null; + } + final String[] typeNames = new String[columnDescriptors.size()]; + int i = 0; + for ( ColumnDescriptor columnDescriptor : columnDescriptors ) { + typeNames[i++] = columnDescriptor.typeName(); + } + return typeNames; } @Override @@ -1412,9 +1427,7 @@ public String getCatalogName(int column) { @Override public String getColumnTypeName(int column) { - // This information is in rows.columnDescriptors().get( column-1 ).dataType.name - // but does not appear to be accessible. - return null; + return typeNames[column - 1]; } @Override