Juan,
You need to use declare parents to make the
annotated types implement a marker interface, and then do your inter-type declaration
on the interface.
From:
aspectj-dev-bounces@xxxxxxxxxxx [mailto:aspectj-dev-bounces@xxxxxxxxxxx] On Behalf Of Juan Bernabo
Sent: Thursday, May 17, 2007 7:45
PM
To: aspectj-dev@xxxxxxxxxxx
Subject: [aspectj-dev] Inter-type
declaration for annotated classes
Hi,
I would like to know if is supported in AspectJ an inter-type declaration of a
field or a method for an annotated class.
I want to introduce a field, into a class annotated with @Identifiable
@Identifiable
class TestEntity
{
....
};
In the aspect I want to introduce a new field or method like:
@ javax.persistence.Id
String TestEntity.id;
Declaring the field that way works but I don´t to want to explicit the class, I
want to introduce this field in any class with the @Identifiable annotation,
probably the declaration would be something like this:
@javax.persistence.Id
String @ Identifiable.id;
I tried putting the field in a new class and introduce it by declare partents,
that supports annotations but hibernate and other products does´t seem to like
this, as it´s not exactly part of the original class.
Is this supported, if not, will this be supported?
Thanks in advance,
Juan.
--
TeamWare do Brasil
Equipes Altamente Eficazes
Agilidade, Pessoas e Tecnologia
Tel: +55 (11) 5061-8221