Results 1 to 3 of 3

Thread: Roo addon managing multiple ITD files?

  1. #1
    Join Date
    May 2010
    Posts
    11

    Question Roo addon managing multiple ITD files?

    Hi,

    Is it possible to let one Roo addon manage multiple ITD files for the same class? For example based on annotated field of MyEntity let the addon manage both
    MyEntity_Roo_MyPlugin_Field1.aj
    MyEntity_Roo_MyPlugin_Field2.aj
    ..files and also realize when field has been deleted and then delete corresponding ITD file.

    Tnx in advance,
    Ats U.

    PS. I just tried to create my first roo addon (haven't jet had time to understand all the code) and I'm sorry if the answer to my question is trivial enough for me to be shamed, but the first impression that I had was that maybe it is not supported

  2. #2
    Join Date
    Dec 2005
    Posts
    929

    Default

    No problems. The addon-entity already manages two ITDs - entity and identifier (for composite keys). However in this example, the java class can only be annotated with one or the other. But @RooEntity and other Roo annotations like @RooToString etc can be added to the same class, thus producing multiple ITDs. One immutable metadata class can and should only maintain one ITD.
    Last edited by Alan Stewart; Jan 3rd, 2011 at 09:43 PM.
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  3. #3
    Join Date
    May 2010
    Posts
    11

    Default

    Tnx for the answer.

    Quote Originally Posted by Alan Stewart View Post
    However in this example, the java class can only be annotated with one or the other.
    Yes, I understood it before, and that is what I intended to do.

    Quote Originally Posted by Alan Stewart View Post
    But @RooEntity and other Roo annotations like @RooToString etc can be added to the same class, thus producing multiple ITDs.
    Yes, I understood that as well - seen them in action.

    However what I wanted to know, was answered by following sentence (just as I suspected based on looking into AddonMetadataProvider.java):
    Quote Originally Posted by Alan Stewart View Post
    One immutable metadata class can and should only maintain one ITD.
    Originally I thought that for every distinct field type(what ever user might use or create) that has been annotated by my addon specific annotation I would generate one ITD file for readability, but there is no problem to put them all into single .aj file.

    Tnx again, Alan!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •