Interface ColumnAliasExtractor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Extracts the unique result-column alias used while auto-discovering native SQL query results.
Use COLUMN_LABEL_EXTRACTOR for JDBC drivers which correctly report the
projected alias through ResultSetMetaData.getColumnLabel(int). Use
COLUMN_NAME_EXTRACTOR only for drivers which require
ResultSetMetaData.getColumnName(int) instead. The supplied position is the
one-based JDBC column position and must be forwarded unchanged.
Implementations must propagate SQLException so Hibernate can apply its
normal JDBC exception handling.
- Since:
- 8.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ColumnAliasExtractorThe stock extractor which callsResultSetMetaData.getColumnLabel(int).static final ColumnAliasExtractorThe stock extractor which callsResultSetMetaData.getColumnName(int). -
Method Summary
Modifier and TypeMethodDescriptionextractColumnAlias(ResultSetMetaData metaData, int position) Extract the alias at the given one-based JDBC column position.
-
Field Details
-
COLUMN_LABEL_EXTRACTOR
The stock extractor which callsResultSetMetaData.getColumnLabel(int). -
COLUMN_NAME_EXTRACTOR
The stock extractor which callsResultSetMetaData.getColumnName(int).
-
-
Method Details
-
extractColumnAlias
Extract the alias at the given one-based JDBC column position.- Parameters:
metaData- the result-set metadataposition- the one-based JDBC column position- Returns:
- the reported alias
- Throws:
SQLException- when the driver cannot access the metadata
-