Lifecycle event annotations support
-----------------------------------

                 Key: CAY-1509
                 URL: https://issues.apache.org/jira/browse/CAY-1509
             Project: Cayenne
          Issue Type: Task
          Components: Core Library
    Affects Versions: 3.1M1
            Reporter: Andrus Adamchik
            Assignee: Andrus Adamchik
             Fix For: 3.1M1


Add annotations for lifecycle events:

@PrePersist, @PostPersist, etc. (all the standard ones, total of 8 annotations)

Each annotated method can process events for preset collection of entity 
classes and/or a set of unknown entity classes tagged with a custom annotation. 
In the later case a listener is cleanly decoupled from specific entities (this 
feature is mixin-inspired). E.g:

@Target(METHOD) @Retention(RUNTIME)
@PrePersist {
   Class<? extends Persistent>[] entityTypes();
   Class<? extends Annotation>[] entityAnnotations();
}

LifecycleCallbackRegistry API:

/**
 * This form of listener registration is very simple and type-safe compared to 
other forms available in 3.0 LifecycleCallbackRegistry.
 */
public void addListener(Object annotatedListener);



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to