File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
hibernate-core/src/main/java/org/hibernate/internal Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 117117import java .util .function .Function ;
118118
119119import static java .lang .Boolean .TRUE ;
120+ import static org .hibernate .boot .model .naming .Identifier .toIdentifier ;
120121import static org .hibernate .internal .util .StringHelper .isEmpty ;
121122import static org .hibernate .query .sqm .internal .SqmUtil .verifyIsSelectStatement ;
122123
@@ -712,8 +713,13 @@ private boolean useSchemaBasedMultiTenancy() {
712713 }
713714
714715 private String tenantSchema () {
715- final var tenantSchemaMapper = factory .getSessionFactoryOptions ().getTenantSchemaMapper ();
716- return tenantSchemaMapper == null ? null : tenantSchemaMapper .schemaName ( tenantIdentifier );
716+ final var mapper = factory .getSessionFactoryOptions ().getTenantSchemaMapper ();
717+ return mapper == null ? null : normalizeSchemaName ( mapper .schemaName ( tenantIdentifier ) );
718+ }
719+
720+ private String normalizeSchemaName (String schemaName ) {
721+ return jdbcServices .getJdbcEnvironment ().getIdentifierHelper ()
722+ .toMetaDataSchemaName ( toIdentifier ( schemaName ) );
717723 }
718724
719725 private transient String initialSchema ;
You can’t perform that action at this time.
0 commit comments