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
When using "formula" kind of property on GORM entity and marking whole class as dirty, then during entity's save GORM Hibernate will want to include "formula" also into update clause. Hibernate ignores it, but started to log about such situations on WARN level: "HHH000502: The [formula_kind_property_name] property of the [entity_class_name] entity was modified, but it won't be updated because the property is immutable." For workaround, I will make sure that only changed properties are marked dirty and will not use method to mark whole class as dirty. But it would be nice to be able to use markDirty on whole class, with formulas.
Task List
Steps to reproduce provided
Example that reproduces the problem uploaded to Github
Full description of the issue provided (see below)
Steps to Reproduce
Define formula kind of property on Domain class
Use markDirty() to mark whole Domain class dirty
Save the Domain class
Expected Behaviour
Should save without Hibernate warnings
Actual Behaviour
As Hibernate warns about, GORM should not try to include formula kind of property into SQL update/insert clause.
Its warning and Hibernate will exclude it, but it will pollute logs.
Workaround is not to mark the whole Domain as dirty and mark by each field, when needed
When using "formula" kind of property on GORM entity and marking whole class as dirty, then during entity's save GORM Hibernate will want to include "formula" also into update clause. Hibernate ignores it, but started to log about such situations on WARN level: "HHH000502: The [formula_kind_property_name] property of the [entity_class_name] entity was modified, but it won't be updated because the property is immutable." For workaround, I will make sure that only changed properties are marked dirty and will not use method to mark whole class as dirty. But it would be nice to be able to use markDirty on whole class, with formulas.
Task List
Steps to Reproduce
markDirty()
to mark whole Domain class dirtyExpected Behaviour
Should save without Hibernate warnings
Actual Behaviour
As Hibernate warns about, GORM should not try to include formula kind of property into SQL update/insert clause.
Its warning and Hibernate will exclude it, but it will pollute logs.
Workaround is not to mark the whole Domain as dirty and mark by each field, when needed
Environment Information
Example Application
https://github.com/aulea/gorm_dirtiness_issue_demo - Contains integration test to demonstrate that marking whole domain class as dirty, which contains formula type of property will cause warning by Hibernate
The text was updated successfully, but these errors were encountered: