mvinas1977 opened a new issue, #14570:
URL: https://github.com/apache/grails-core/issues/14570
I have this simple model
```
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')
}
```
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](https://github.com/mvinas1977/gorm-proxy-dirty-property-issue)
I'm using the following versions
> grailsVersion=3.3.5
> gormVersion=6.1.10.BUILD-SNAPSHOT
> grailsNeo4jPluginVersion=6.2.0.BUILD-SNAPSHOT
>
--
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]