borinquenkid opened a new issue, #16774: URL: https://github.com/apache/grails-core/issues/16774
Follow-up to #16701. ### 1. Restrict `<element> is not null` only when sharing a key column In `SharedJoinTableUniqueKeyBinder`, `hasColumnsOfOthers` currently applies `<element> is not null` to the default shared table shape (`hasMany = [allow: Member, deny: Member]` with no mapping), where each association has its own distinct key column and only the element column is shared. The predicate separates nothing in that default shape because each association's rows are already selected and deleted by its own key column. However, having `where` restrictions causes `RestrictedCollectionSqmTranslatorFactory` to translate `is empty` into a count query instead of `not exists (select 1 ...)`, and adds a redundant predicate to every load and delete statement. Restricting only when sharing collections have a key column in common (e.g., explicit `joinTable` mappings sharing a foreign key column) preserves optimal SQL for the default shape and limits the SQL translator override to the single case that requires it. ### 2. Documentation adjustments in upgrade guide In `upgrading80x.adoc`: - Adjust the paragraph structure so the sentence describing lists, maps, and bags follows the Oracle/Db2 explanation and avoids ambiguity regarding "that" unique key. - Add documentation noting that GORM sets `hibernate.query.sqm.translator` by default, and that configuring a custom translator retains user configuration while bypassing the `#16748` shared-key `is empty` translator fix. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
