HHH-7483 fix test failures caused by quoting table name
This commit is contained in:
parent
e4bf3e4583
commit
127283374d
|
@ -216,14 +216,8 @@ public class MultipleHiLoPerTableGenerator implements PersistentIdentifierGenera
|
|||
String normalizedTableName = tableName;
|
||||
String normalizedSchemaName = normalizer.normalizeIdentifierQuoting( params.getProperty( SCHEMA ) );
|
||||
String normalizedCatalogName = normalizer.normalizeIdentifierQuoting( params.getProperty( CATALOG ) );
|
||||
|
||||
tableName = org.hibernate.mapping.Table.qualify(
|
||||
dialect.quote( normalizedCatalogName ),
|
||||
dialect.quote( normalizedSchemaName ),
|
||||
dialect.quote( tableName )
|
||||
);
|
||||
|
||||
qualifiedTableName = new ObjectName( normalizedCatalogName, normalizedSchemaName, normalizedTableName );
|
||||
tableName = qualifiedTableName.toText( dialect );
|
||||
}
|
||||
else {
|
||||
qualifiedTableName = ObjectName.parse( tableName );
|
||||
|
|
|
@ -106,12 +106,7 @@ public class SequenceGenerator
|
|||
if ( sequenceName.indexOf( '.' ) < 0 ) {
|
||||
final String schemaName = normalizer.normalizeIdentifierQuoting( params.getProperty( SCHEMA ) );
|
||||
final String catalogName = normalizer.normalizeIdentifierQuoting( params.getProperty( CATALOG ) );
|
||||
sequenceName = Table.qualify(
|
||||
dialect.quote( catalogName ),
|
||||
dialect.quote( schemaName ),
|
||||
dialect.quote( sequenceName )
|
||||
);
|
||||
|
||||
sequenceName = new ObjectName( catalogName, schemaName, sequenceName ).toText( dialect );
|
||||
this.qualifiedSequenceName = new ObjectName( catalogName, schemaName, sequenceName );
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -46,6 +46,7 @@ import org.hibernate.internal.util.config.ConfigurationHelper;
|
|||
import org.hibernate.jdbc.AbstractReturningWork;
|
||||
import org.hibernate.mapping.Table;
|
||||
import org.hibernate.metamodel.spi.relational.Database;
|
||||
import org.hibernate.metamodel.spi.relational.ObjectName;
|
||||
import org.hibernate.type.Type;
|
||||
|
||||
/**
|
||||
|
@ -108,11 +109,7 @@ public class TableGenerator implements PersistentIdentifierGenerator, Configurab
|
|||
if ( tableName.indexOf( '.' ) < 0 ) {
|
||||
final String schemaName = normalizer.normalizeIdentifierQuoting( params.getProperty( SCHEMA ) );
|
||||
final String catalogName = normalizer.normalizeIdentifierQuoting( params.getProperty( CATALOG ) );
|
||||
tableName = Table.qualify(
|
||||
dialect.quote( catalogName ),
|
||||
dialect.quote( schemaName ),
|
||||
dialect.quote( tableName )
|
||||
);
|
||||
tableName = new ObjectName(catalogName, schemaName, tableName).toText( dialect );
|
||||
}
|
||||
else {
|
||||
// if already qualified there is not much we can do in a portable manner so we pass it
|
||||
|
|
|
@ -350,11 +350,7 @@ public class TableGenerator implements PersistentIdentifierGenerator, Configurab
|
|||
|
||||
qualifiedTableName = new ObjectName( catalogName, schemaName, name );
|
||||
|
||||
name = Table.qualify(
|
||||
qualifiedTableName.getCatalog().getText( dialect ),
|
||||
qualifiedTableName.getSchema().getText( dialect ),
|
||||
qualifiedTableName.getName().getText( dialect )
|
||||
);
|
||||
name = qualifiedTableName.toText( dialect );
|
||||
}
|
||||
else {
|
||||
qualifiedTableName = ObjectName.parse( name );
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.hibernate.jpa.internal.util.PersistenceUtilHelper;
|
|||
*/
|
||||
@Deprecated
|
||||
public class HibernatePersistence extends HibernatePersistenceProvider implements PersistenceProvider, AvailableSettings {
|
||||
private final PersistenceUtilHelper.MetadataCache cache = new PersistenceUtilHelper.MetadataCache();
|
||||
// private final PersistenceUtilHelper.MetadataCache cache = new PersistenceUtilHelper.MetadataCache();
|
||||
|
||||
// /**
|
||||
// * Get an entity manager factory by its entity manager name, using the specified
|
||||
|
|
Loading…
Reference in New Issue