[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] @Entity but not subclass of @Entity

Hi All,
I have a problem. I add some methods to beans annotated with @Entity. Some @Entity extends other @Entity, with the result that methods are added to both types. I added a check to avoid adding them if they are already there (using !hasmethod(...)), but it works or does not work depending on the class loading sequence (which is IMHO a bug I'll write another mail about).

Anyway, it could be easy to solve writing "Apply this to @Entity beans that does not subclass another @Entity bean", I tried writing "(@Entity *) && !((@Entity *)+)", but it does not work obviously. I also tried an if on thisJoinPointStaticPart, but it is not usable there.

Is there a way to do it? Is there an "exclusive +" that matches subclasses but not also the base class? While it is handy to write execution(MyClass+ .....) to match both class and subclass, and while there is a way to select all subclasses when the class name is known, I can't find a way to do it with annotations.


Simone Gianni            CEO Semeru s.r.l.           Apache Committer