You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Club {
String name
static constraints = {
name nullable: false
}
}
class Player {
String name
@BindUsing({ Player player, SimpleMapDataBindingSource source ->
if (source['club']?.id) {
return Club.get(source['club']?.id as Long)
}
})
Club club
static constraints = {
name nullable: false
club nullable: false
}
}
Player has a custom binding ... if you bind same club it marks club as dirty when it should not. this simple test reproduce the error
void "test dirty hibernate"() {
given:
Club club = Club.findByName('Boca Juniors')
assert club
Player player = Player.findByName('Juan Roman Riquelme')
assert player
when:
player.properties = [club: [id: club.id]]
then:
!player.hasChanged('club')
}
I have this simple model
Player has a custom binding ... if you bind same club it marks club as dirty when it should not. this simple test reproduce the error
Same code works fine with hibernate
I shared a proyect with this example app to reproduce this error https://github.com/mvinas1977/gorm-proxy-dirty-property-issue
I'm using the following versions
The text was updated successfully, but these errors were encountered: