ianroberts commented on issue #16665:
URL: https://github.com/apache/grails-core/issues/16665#issuecomment-6286205779

   > One point from this thread is not changed by #16686: when two properties 
do share a join table, the key stays non-updatable, so an element added to one 
of those is still not written. Whether that case should fail at startup instead 
is a separate decision.
   
   Given the foreign key columns are no longer created as `not null` on 
hibernate 7, it would be an interesting test to disable this non-updatable key 
logic entirely and then see what breaks. Given that (presumably) queries on the 
join table for a unidirectional `hasMany` will always include something like 
`where item_roles_id = ?`, it may be perfectly fine to use one join table for 
both associations with one of the columns always null.
   
   It'd be good to add a db level unique constraint for both associations (not 
just the first declared one, as at present), but other than that it may be that 
this logic can be removed altogether.


-- 
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]

Reply via email to