Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
4.0.M3, 4.0.M4, 4.0.M5, 3.1, 3.1.1, 3.1.2, 4.2
-
None
-
None
Description
With regards to the PrePersist & PreUpdate lifecycle events it appears that developers are expecting these events to take place before validation occurs, as the original docs for 3.1 also indicate.
Developers are trying to use these as a place to set default values before the actual commit occurs, but validation prevents this from happening. It was also noted that to make changes to the data after validation is not good practice.
Options:
1. Move the lifecycle events to occur before validation (and update the docs for 4)
2. or Update the docs to clarify the function of PrePersist & PreUpdate, i.e. what it is for, what it is not for, and provide suggestions as to where / how to accomplish the not for things that developers are currently trying to do.