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

Support superclass entity callbacks

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.0M1
    • Core Library
    • None

    Description

      We need an ability to define a callback method in a common superclass of some entities and register it just once:

      LifecycleEventCallbackMap prePersist = ...
      prePersist.addListener(MySuper.class, "prePersist");

      Then individual entities may choose to override this method if they want to customize the behavior of callback. Or they may implicitly rely on the superclass. JPA supports that as "listeners on mapped superclass". Cayenne doesn't have a formal notion of a mapped superclass (abstract entity would be the closest), and we can simply support it on any superclass that is registered explicitly.

      (also note that JPA supports "excludes superclass" flag ... not sure if it is applicable here, as the registration is explicit.

      Attachments

        Issue Links

          Activity

            People

              andrus Andrus Adamchik
              andrus Andrus Adamchik
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: