Package org.hibernate.dialect
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.
Strategy for extracting the unique column alias out of a
ResultSetMetaData
. This is used during the
"auto discovery" phase of native SQL queries.
Generally this should be done via ResultSetMetaData.getColumnLabel(int)
, but not all drivers do this correctly.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ColumnAliasExtractor
An extractor which usesResultSetMetaData.getColumnLabel(int)
static final ColumnAliasExtractor
An extractor which usesResultSetMetaData.getColumnName(int)
-
Method Summary
Modifier and TypeMethodDescriptionextractColumnAlias
(ResultSetMetaData metaData, int position) Extract the unique column alias.
-
Field Details
-
COLUMN_LABEL_EXTRACTOR
An extractor which usesResultSetMetaData.getColumnLabel(int)
-
COLUMN_NAME_EXTRACTOR
An extractor which usesResultSetMetaData.getColumnName(int)
-
-
Method Details
-
extractColumnAlias
Extract the unique column alias.- Parameters:
metaData
- The result set metadataposition
- The column position- Returns:
- The alias
- Throws:
SQLException
- Indicates a problem accessing the JDBC ResultSetMetaData
-