grails-data-mapping
grails-data-mapping copied to clipboard
Updating the compositeId fields does not persist in database
When there is a domain with composite Id, and if one of the field in compositeId is changed, saving the domain (even with flush) will not persist the change to database. Dirty checking works, but the save wont update the values, no update query is being fired in hibernate logs, subsequent select wont find new values. This used to work earlier.
Grails: 3.3.2 Also reproducible with Gorm 6.1.11.BUILD-SNAPSHOT
Attached sample has a CompositeIdSpec which reveals the issue bugwork-composite-id.zip
@snimavat Normally it's not a good idea to change the primary key. If you want a record with a different primary key you should delete the first one and re-insert.
@jameskleeh I agree, however this used to work, but not now, so probably some thing related to gorm and not hibernate... even if this is not a good practice, can we agree, that this is a bug, should it work or not ?
Any update on this one !? is it planned to fix !