cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <>
Subject [jira] Created: (CAY-1509) Lifecycle event annotations support
Date Sun, 14 Nov 2010 03:39:13 GMT
Lifecycle event annotations support

                 Key: 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.

View raw message