Class AbstractReactiveInformationSchemaBasedExtractorImpl
- java.lang.Object
-
- org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
- org.hibernate.reactive.provider.service.AbstractReactiveInformationSchemaBasedExtractorImpl
-
- All Implemented Interfaces:
org.hibernate.tool.schema.extract.spi.InformationExtractor
- Direct Known Subclasses:
MySqlReactiveInformationExtractorImpl
,OracleSqlReactiveInformationExtractorImpl
,PostgreSqlReactiveInformationExtractorImpl
,SqlServerReactiveInformationExtractorImpl
public abstract class AbstractReactiveInformationSchemaBasedExtractorImpl extends org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
An implementation ofInformationExtractor
that obtains metadata information from a database's information_schema.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl.ForeignKeyBuilder, org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl.ForeignKeyBuilderImpl
-
-
Constructor Summary
Constructors Constructor Description AbstractReactiveInformationSchemaBasedExtractorImpl(org.hibernate.tool.schema.extract.spi.ExtractionContext extractionContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addExtractedColumnInformation(org.hibernate.tool.schema.extract.spi.TableInformation tableInformation, java.sql.ResultSet resultSet)
protected boolean
appendClauseAndParameterIfNotNullOrEmpty(java.lang.String clause, java.lang.Object parameter, java.lang.StringBuilder sb, java.util.List<java.lang.Object> parameters)
protected int
dataTypeCode(java.lang.String typeName)
Return a JDBC Type code for the given type nameprotected java.lang.String
getDatabaseCatalogColumnName(java.lang.String catalogColumnName, java.lang.String schemaColumnName)
Given a catalog column name and a schema column name in an information_schema table/view, this method returns the column used for storing the catalog name, or, if there is no valid column containing the catalog name.
protected java.lang.String
getDatabaseSchemaColumnName(java.lang.String catalogColumnName, java.lang.String schemaColumnName)
Given a catalog column name and a schema column name in an information_schema table/view, this method returns the column used for storing the schema name, or, if there is no valid column containing the schema name.
protected java.lang.String
getInformationSchemaColumnsDataTypeColumn()
Gets the name of column in information_schema.columns for the database-specific column type.protected java.lang.String
getResultSetCatalogLabel()
protected java.lang.String
getResultSetColumnNameLabel()
protected java.lang.String
getResultSetColumnPositionColumn()
protected java.lang.String
getResultSetColumnSizeLabel()
protected java.lang.String
getResultSetDecimalDigitsLabel()
protected java.lang.String
getResultSetForeignKeyColumnNameLabel()
protected java.lang.String
getResultSetForeignKeyLabel()
protected java.lang.String
getResultSetIndexNameLabel()
protected java.lang.String
getResultSetIndexTypeLabel()
protected java.lang.String
getResultSetIsNullableLabel()
protected java.lang.String
getResultSetPrimaryKeyCatalogLabel()
protected java.lang.String
getResultSetPrimaryKeyColumnNameLabel()
protected java.lang.String
getResultSetPrimaryKeyNameLabel()
protected java.lang.String
getResultSetPrimaryKeySchemaLabel()
protected java.lang.String
getResultSetPrimaryKeyTableLabel()
protected java.lang.String
getResultSetRemarksLabel()
protected java.lang.String
getResultSetSchemaLabel()
protected java.lang.String
getResultSetSqlTypeCodeLabel()
protected java.lang.String
getResultSetTableNameLabel()
protected java.lang.String
getResultSetTableTypeLabel()
protected java.lang.String
getResultSetTableTypesPhysicalTableConstant()
protected java.lang.String
getResultSetTypeNameLabel()
protected <T> T
processCatalogsResultSet(org.hibernate.tool.schema.extract.spi.ExtractionContext.ResultSetProcessor<T> processor)
protected <T> T
processColumnsResultSet(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String columnNamePattern, org.hibernate.tool.schema.extract.spi.ExtractionContext.ResultSetProcessor<T> processor)
protected <T> T
processSchemaResultSet(java.lang.String catalog, java.lang.String schemaPattern, org.hibernate.tool.schema.extract.spi.ExtractionContext.ResultSetProcessor<T> processor)
protected <T> T
processTableResultSet(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String[] types, org.hibernate.tool.schema.extract.spi.ExtractionContext.ResultSetProcessor<T> processor)
-
Methods inherited from class org.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
addColumns, catalogExists, convertSQLException, determineCatalogFilter, determineSchemaFilter, getExtractionContext, getForeignKeys, getIndexes, getPrimaryKey, getTable, getTables, identifierHelper, interpretNullable, isPhysicalTableType, processImportedKeysResultSet, processIndexInfoResultSet, processPrimaryKeysResultSet, schemaExists, toMetaDataObjectName
-
-
-
-
Method Detail
-
getResultSetCatalogLabel
protected java.lang.String getResultSetCatalogLabel()
- Overrides:
getResultSetCatalogLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetSchemaLabel
protected java.lang.String getResultSetSchemaLabel()
- Overrides:
getResultSetSchemaLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetTableNameLabel
protected java.lang.String getResultSetTableNameLabel()
- Overrides:
getResultSetTableNameLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetTableTypeLabel
protected java.lang.String getResultSetTableTypeLabel()
- Overrides:
getResultSetTableTypeLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetRemarksLabel
protected java.lang.String getResultSetRemarksLabel()
- Overrides:
getResultSetRemarksLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetColumnNameLabel
protected java.lang.String getResultSetColumnNameLabel()
- Overrides:
getResultSetColumnNameLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetSqlTypeCodeLabel
protected java.lang.String getResultSetSqlTypeCodeLabel()
- Overrides:
getResultSetSqlTypeCodeLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetTypeNameLabel
protected java.lang.String getResultSetTypeNameLabel()
- Overrides:
getResultSetTypeNameLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetColumnSizeLabel
protected java.lang.String getResultSetColumnSizeLabel()
- Overrides:
getResultSetColumnSizeLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetDecimalDigitsLabel
protected java.lang.String getResultSetDecimalDigitsLabel()
- Overrides:
getResultSetDecimalDigitsLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetIsNullableLabel
protected java.lang.String getResultSetIsNullableLabel()
- Overrides:
getResultSetIsNullableLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetIndexTypeLabel
protected java.lang.String getResultSetIndexTypeLabel()
- Overrides:
getResultSetIndexTypeLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetIndexNameLabel
protected java.lang.String getResultSetIndexNameLabel()
- Overrides:
getResultSetIndexNameLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetForeignKeyLabel
protected java.lang.String getResultSetForeignKeyLabel()
- Overrides:
getResultSetForeignKeyLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetPrimaryKeyNameLabel
protected java.lang.String getResultSetPrimaryKeyNameLabel()
- Overrides:
getResultSetPrimaryKeyNameLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetColumnPositionColumn
protected java.lang.String getResultSetColumnPositionColumn()
- Overrides:
getResultSetColumnPositionColumn
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetPrimaryKeyColumnNameLabel
protected java.lang.String getResultSetPrimaryKeyColumnNameLabel()
- Overrides:
getResultSetPrimaryKeyColumnNameLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetForeignKeyColumnNameLabel
protected java.lang.String getResultSetForeignKeyColumnNameLabel()
- Overrides:
getResultSetForeignKeyColumnNameLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetPrimaryKeyCatalogLabel
protected java.lang.String getResultSetPrimaryKeyCatalogLabel()
- Overrides:
getResultSetPrimaryKeyCatalogLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetPrimaryKeySchemaLabel
protected java.lang.String getResultSetPrimaryKeySchemaLabel()
- Overrides:
getResultSetPrimaryKeySchemaLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetPrimaryKeyTableLabel
protected java.lang.String getResultSetPrimaryKeyTableLabel()
- Overrides:
getResultSetPrimaryKeyTableLabel
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
getResultSetTableTypesPhysicalTableConstant
protected java.lang.String getResultSetTableTypesPhysicalTableConstant()
- Specified by:
getResultSetTableTypesPhysicalTableConstant
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
-
processCatalogsResultSet
protected <T> T processCatalogsResultSet(org.hibernate.tool.schema.extract.spi.ExtractionContext.ResultSetProcessor<T> processor) throws java.sql.SQLException
- Specified by:
processCatalogsResultSet
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
- Throws:
java.sql.SQLException
-
processSchemaResultSet
protected <T> T processSchemaResultSet(java.lang.String catalog, java.lang.String schemaPattern, org.hibernate.tool.schema.extract.spi.ExtractionContext.ResultSetProcessor<T> processor) throws java.sql.SQLException
- Specified by:
processSchemaResultSet
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
- Throws:
java.sql.SQLException
-
appendClauseAndParameterIfNotNullOrEmpty
protected boolean appendClauseAndParameterIfNotNullOrEmpty(java.lang.String clause, java.lang.Object parameter, java.lang.StringBuilder sb, java.util.List<java.lang.Object> parameters)
-
processTableResultSet
protected <T> T processTableResultSet(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String[] types, org.hibernate.tool.schema.extract.spi.ExtractionContext.ResultSetProcessor<T> processor) throws java.sql.SQLException
- Specified by:
processTableResultSet
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
- Throws:
java.sql.SQLException
-
processColumnsResultSet
protected <T> T processColumnsResultSet(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String columnNamePattern, org.hibernate.tool.schema.extract.spi.ExtractionContext.ResultSetProcessor<T> processor) throws java.sql.SQLException
- Specified by:
processColumnsResultSet
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
- Throws:
java.sql.SQLException
-
getInformationSchemaColumnsDataTypeColumn
protected java.lang.String getInformationSchemaColumnsDataTypeColumn()
Gets the name of column in information_schema.columns for the database-specific column type.- Returns:
- the name of column in information_schema.columns for the database-specific column type
-
getDatabaseCatalogColumnName
protected java.lang.String getDatabaseCatalogColumnName(java.lang.String catalogColumnName, java.lang.String schemaColumnName)
Given a catalog column name and a schema column name in an information_schema table/view, this method returns the column used for storing the catalog name, or, if there is no valid column containing the catalog name. MySQL, for example, uses the schema name column in the information_schema to store the catalog name. (@see MySqlReactiveInformationExtractorImpl)
- Parameters:
catalogColumnName
- - the catalog column nameschemaColumnName
- - the schema column name- Returns:
- the column used for storing the catalog name,
or
if there is no valid column containing the catalog name.
-
getDatabaseSchemaColumnName
protected java.lang.String getDatabaseSchemaColumnName(java.lang.String catalogColumnName, java.lang.String schemaColumnName)
Given a catalog column name and a schema column name in an information_schema table/view, this method returns the column used for storing the schema name, or, if there is no valid column containing the schema name. MySQL, for example, does not have a valid column in in the information_schema to store the schema name. (@see MySqlReactiveInformationExtractorImpl)
- Parameters:
catalogColumnName
- - the catalog column nameschemaColumnName
- - the schema column name- Returns:
- the column used for storing the schema name,
or
if there is no valid column containing the schema name.
-
addExtractedColumnInformation
protected void addExtractedColumnInformation(org.hibernate.tool.schema.extract.spi.TableInformation tableInformation, java.sql.ResultSet resultSet) throws java.sql.SQLException
- Overrides:
addExtractedColumnInformation
in classorg.hibernate.tool.schema.extract.internal.AbstractInformationExtractorImpl
- Throws:
java.sql.SQLException
-
dataTypeCode
protected int dataTypeCode(java.lang.String typeName)
Return a JDBC Type code for the given type name
-
-