Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » Override @GeneratedValue annotation with AspectJ(Override annotated values with aspectj file)
Override @GeneratedValue annotation with AspectJ [message #532820] Tue, 11 May 2010 10:06 Go to next message
ricardo_garcia is currently offline ricardo_garcia
Messages: 2
Registered: May 2010
Junior Member
Hi!

I'm generating an annotation to set a defined sequenceValue to an id field for an Entity in Postgres DDBB.

I've been looking in AspectJ documentation:

- http://www.eclipse.org/aspectj/doc/released/adk15notebook/an notations-decp.html#declare-precedence

to apply precende rules between aspects.

I've created a new aspect applying the precedence rules and adding annotations to fields:

privileged aspect Person_Company_generated_id {

    declare precedence: Person_Company_generated_id, Person_Roo_Entity;
  
    declare @field: * org.company.test.generated.id.sequence.domain.Person.id : @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="PersonSeq");
    
    declare @field: * org.company.test.generated.id.sequence.domain.Person.id : @SequenceGenerator(name="PersonSeq",sequenceName="PERSON_SEQ", allocationSize=500, initialValue=601);
}


The aspect generated Person_Roo_Entity defines the annotation in the id attribute:
     @id
     @GeneratedValue(strategy = GenerationType.AUTO)


This only works if I remove the @GeneratedValue annotation from Person_Roo_Entity.

These rules can't override the behaviour of the @GeneratedValue annotation with the attributes that I redefined.

What I'm doing wrong?How can I override the behaviour/definition of @GeneratedValue with Aspects? is the preference wrong defined? Exists another way to override a sequence to an identifier with aspects?

Scenario:
* JDK-1.5.0_07
* PostgreSQL 8.3.8
* AspectJ 1.6.9.BUILD-SNAPSHOT

Thanks for your time.

Regards...

[Updated on: Tue, 11 May 2010 11:35]

Report message to a moderator

Re: Override @GeneratedValue annotation with AspectJ [message #533445 is a reply to message #532820] Thu, 13 May 2010 22:31 Go to previous message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 368
Registered: July 2009
Senior Member
Hi there,

Please post on the AspectJ mailing list:

http://eclipse.org/aspectj/userlists.php
Previous Topic:Eclipse asking over and over to enable JDT Weaving
Next Topic:Override @GeneratedValue annotation with AspectJ
Goto Forum:
  


Current Time: Sat Sep 20 10:01:58 GMT 2014

Powered by FUDForum. Page generated in 0.07126 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software