Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] A way to change annotation declaration by aspect or adding an attribute.

Le 13/08/2012 17:39, Andy Clement a écrit :
Hi,
Hi Andy,
Thanks for yours answers.

At the moment you can't partially replace an annotation (by modifying
some of the annotation values), but you could remove an annotation and
add a different one its place, feasibly, if using the annotation
removal construct:

declare @field : * *uuid: -@Column;
declare @field : * *uuid : @Column(columnDefinition="uuid NOT NULL");

But your nullable value will be lost.  This bugzilla
https://bugs.eclipse.org/bugs/show_bug.cgi?id=313026 is covering some
of the potential enhancements here
(augmentation/replacement/precedence for declare annotation).
The replace solution is possible in my context. I need to create 2 aspects to define the precedence.
Are there a way to use dynamic construction with declare @field
I'm afraid not.  This could be feasible for fixed elements at a
joinpoint that are known at compile/weave time (so those encapsulated
in thisJoinPointStaticPart), but not for the more dynamic features in
thisJoinPoint which aren't known until runtime.  Feel free to raise an
enhancement request for this.
Have you an exemple that would be feasible ?

cheers,
Andy
Best regards,
Jean-Jacques.

On 13 August 2012 02:53, Jean-Jacques Peyronel
<jjpeyronel@xxxxxxxxxxxxxx> wrote:
Hi all,

I have this :

@Column(name="account_category_uuid", nullable=false)
@Id
private java.util.UUID account_category_uuid;

I want an aspect who change :
@Column(name="account_category_uuid", nullable=false)
to
@Column(name="account_category_uuid", nullable=false,
columnDefinition="uuid NOT NULL")

I've a lot of class with this sort of declaration.

I've tried :
declare @field : * *uuid : @Column(columnDefinition="uuid NOT NULL");
but this seems not change the first declaration.

Are there a way to use dynamic construction with declare @field like :
@Column(name=thisjointpoint+"_uuid", nullable=false,
columnDefinition="uuid NOT NULL")

Thanks in advance.

Jean-Jacques.

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users
begin:vcard
fn:Jean-Jacques Peyronel
n:Peyronel;Jean-Jacques
org:TOWA France;Informatique
adr:Ch de la bastide blanche;;Parc GVIO Bat A5;Vitrolles;;13127;France
email;internet:jjpeyronel@xxxxxxxxxxxxxx
title;quoted-printable:D=C3=A9veloppeur
tel;work:04 42 34 01 37
tel;fax:04 42 34 01 45
url:http://www.towa-france.fr
version:2.1
end:vcard

Attachment: signature.asc
Description: OpenPGP digital signature


Back to the top