Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-2254

Move PrePersist & PreUpdate lifecycle events to occur before validation

    XMLWordPrintableJSON

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
    • Core Library, Documentation
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jurgen Jurgen Doll
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: