Search in sources :

Example 1 with DatabaseIdentifier

use of org.hibernate.boot.model.naming.DatabaseIdentifier in project hibernate-orm by hibernate.

the class InformationExtractorJdbcDatabaseMetaDataImpl method extractTableName.

private QualifiedTableName extractTableName(ResultSet resultSet) throws SQLException {
    final String incomingCatalogName = resultSet.getString("TABLE_CAT");
    final String incomingSchemaName = resultSet.getString("TABLE_SCHEM");
    final String incomingTableName = resultSet.getString("TABLE_NAME");
    final DatabaseIdentifier catalog = DatabaseIdentifier.toIdentifier(incomingCatalogName);
    final DatabaseIdentifier schema = DatabaseIdentifier.toIdentifier(incomingSchemaName);
    final DatabaseIdentifier table = DatabaseIdentifier.toIdentifier(incomingTableName);
    return new QualifiedTableName(catalog, schema, table);
}
Also used : QualifiedTableName(org.hibernate.boot.model.relational.QualifiedTableName) DatabaseIdentifier(org.hibernate.boot.model.naming.DatabaseIdentifier)

Example 2 with DatabaseIdentifier

use of org.hibernate.boot.model.naming.DatabaseIdentifier in project hibernate-orm by hibernate.

the class InformationExtractorJdbcDatabaseMetaDataImpl method extractKeyTableName.

private QualifiedTableName extractKeyTableName(ResultSet resultSet, String prefix) throws SQLException {
    final String incomingCatalogName = resultSet.getString(prefix + "TABLE_CAT");
    final String incomingSchemaName = resultSet.getString(prefix + "TABLE_SCHEM");
    final String incomingTableName = resultSet.getString(prefix + "TABLE_NAME");
    final DatabaseIdentifier catalog = DatabaseIdentifier.toIdentifier(incomingCatalogName);
    final DatabaseIdentifier schema = DatabaseIdentifier.toIdentifier(incomingSchemaName);
    final DatabaseIdentifier table = DatabaseIdentifier.toIdentifier(incomingTableName);
    return new QualifiedTableName(catalog, schema, table);
}
Also used : QualifiedTableName(org.hibernate.boot.model.relational.QualifiedTableName) DatabaseIdentifier(org.hibernate.boot.model.naming.DatabaseIdentifier)

Aggregations

DatabaseIdentifier (org.hibernate.boot.model.naming.DatabaseIdentifier)2 QualifiedTableName (org.hibernate.boot.model.relational.QualifiedTableName)2