cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAY-1872) Easier mapping of default listener methods
Date Thu, 19 Sep 2013 07:38:51 GMT

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

Andrus Adamchik updated CAY-1872:
---------------------------------

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

  was:
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

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. 

    
> 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
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message