Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYWZhM2E3NDlh...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15523?atlOrigin=eyJpIjoiYWZhM2...
) HHH-15523 (
https://hibernate.atlassian.net/browse/HHH-15523?atlOrigin=eyJpIjoiYWZhM2...
) Missing use of SqlStringGenerationContext in MapBinder#getFromAndWhereFormula (
https://hibernate.atlassian.net/browse/HHH-15523?atlOrigin=eyJpIjoiYWZhM2...
)
Issue Type: Bug Affects Versions: 5.6.2 Assignee: Unassigned Components: hibernate-core
Created: 18/Sep/2022 03:00 AM Priority: Major Reporter: Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
After
https://hibernate.atlassian.net/browse/HHH-14921 (
https://hibernate.atlassian.net/browse/HHH-14921 ) introduced SqlStringGenerationContext ,
the use of @MapKey leads to issues when an explicit schema/catalog is specified, because
the generated subquery lacks the schema. I suggest that uses of
org.hibernate.cfg.annotations.MapBinder#getFromAndWhereFormula should use the explicitly
configured schema and catalog names i.e.
final ServiceRegistry serviceRegistry =
buildingContext.getBootstrapContext().getServiceRegistry();
final ConfigurationService configurationService =
serviceRegistry.getService(ConfigurationService.class);
final SqlStringGenerationContext generationContext =
SqlStringGenerationContextImpl.fromExplicit(
serviceRegistry.getService(JdbcServices.class).getJdbcEnvironment(),
buildingContext.getMetadataCollector().getDatabase(),
configurationService.getSetting(AvailableSettings.DEFAULT_CATALOG, String.class, null ),
configurationService.getSetting(AvailableSettings.DEFAULT_SCHEMA, String.class, null )
);
final String tableName =
generationContext.format(associatedClass.getTable().getQualifiedTableName());
(
https://hibernate.atlassian.net/browse/HHH-15523#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15523#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100207- sha1:30c8888 )