Grails
  1. Grails
  2. GRAILS-8230

Inconsistency of GORM beforeValidate event

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.3.7
    • Fix Version/s: None
    • Component/s: Persistence
    • Labels:
    • Environment:
      Linux kernel 2.6.32-33 x86_64
      java version 1.6.0_20
      OpenJDK Runtime Environment (IcedTea6 1.9.9) (6b20-1.9.9-0ubuntu1~10.04.2)
      OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

      Description

      It's minor thing however beforeValidate persistence event is inconsistent because of two things:

      1. It won't be triggered if declared as a closure though other persistence events trigger as closures.
        beforeValidate will be triggered only if declared as a method.
      2. beforeValidate is not on the array returned by the grails.persistence.Event.getAllEvents(). Returned array looks as follows:
        [onLoad, onSave, beforeLoad, beforeInsert, beforeUpdate, beforeDelete, afterLoad, afterInsert, afterUpdate, afterDelete]

        Activity

        Hide
        Tomasz Przybysz added a comment - - edited

        btw. is there any place at documentation which describes or at least lists all Grails persistence events?

        Show
        Tomasz Przybysz added a comment - - edited btw. is there any place at documentation which describes or at least lists all Grails persistence events?

          People

          • Assignee:
            Jeff Scott Brown
            Reporter:
            Tomasz Przybysz
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Last Reviewed:

              Development