Package org.hibernate.dialect
Interface ColumnAliasExtractor
-
public interface ColumnAliasExtractor
Strategy for extracting the unique column alias out of aResultSetMetaData
. This is used during the "auto discovery" phase of native SQL queries. Generally this should be done viaResultSetMetaData.getColumnLabel(int)
, but not all drivers do this correctly.
-
-
Field Summary
Fields Modifier and Type Field Description static ColumnAliasExtractor
COLUMN_LABEL_EXTRACTOR
An extractor which usesResultSetMetaData.getColumnLabel(int)
static ColumnAliasExtractor
COLUMN_NAME_EXTRACTOR
An extractor which usesResultSetMetaData.getColumnName(int)
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
extractColumnAlias(java.sql.ResultSetMetaData metaData, int position)
Extract the unique column alias.
-
-
-
Field Detail
-
COLUMN_LABEL_EXTRACTOR
static final ColumnAliasExtractor COLUMN_LABEL_EXTRACTOR
An extractor which usesResultSetMetaData.getColumnLabel(int)
-
COLUMN_NAME_EXTRACTOR
static final ColumnAliasExtractor COLUMN_NAME_EXTRACTOR
An extractor which usesResultSetMetaData.getColumnName(int)
-
-
Method Detail
-
extractColumnAlias
java.lang.String extractColumnAlias(java.sql.ResultSetMetaData metaData, int position) throws java.sql.SQLException
Extract the unique column alias.- Parameters:
metaData
- The result set metadataposition
- The column position- Returns:
- The alias
- Throws:
java.sql.SQLException
- Indicates a problem accessing the JDBC ResultSetMetaData
-
-