You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Oleg Artyukevich (JIRA)" <ji...@apache.org> on 2014/02/13 17:23:20 UTC

[jira] [Updated] (CAY-1872) Easier mapping of default listener methods

     [ https://issues.apache.org/jira/browse/CAY-1872?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Artyukevich updated CAY-1872:
----------------------------------

    Attachment: cay1872_test.patch
                cay1872.patch

If there are no parameters in annotation, send type of parameter(class or interface) of method when generate collection of default listener ( LifecycleCallbackEventHandler.defaultListeners). Also add check for incoming types of parameters, when try to call default listeners.


> Easier mapping of default listener methods
> ------------------------------------------
>
>                 Key: CAY-1872
>                 URL: https://issues.apache.org/jira/browse/CAY-1872
>             Project: Cayenne
>          Issue Type: Improvement
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>         Attachments: cay1872.patch, cay1872_test.patch
>
>
> IIRC a listener method like this doesn't match anything (the actual annotation can be any lifecycle annotation.. the important part is absent entity filter) :
> @PrePersist
> public void doSomething(T x) { }
> We should actually match that based on the "T" type instead. So if T is an Object or DataObject, it should match every entity in the model, if T is a specific entity class, it should match that specific class. So more generally it should match entities that are of type T or any subtype of T
> Performance is a consideration... T can be a class or an interface. I can see how we can make this efficient with T being a class. With T being an interface other than DataObject or Persistent, we'll need to analyze all persistent classes in the Model, which can affect performance. I guess we can make a partial implementation initially supporting T as a class and DataObject / Persistent interfaces, and then see how bad is a class hierarchy scan with an arbitrary interface. 



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)