Announcement Announcement Module
Collapse
No announcement yet.
Roo addon managing multiple ITD files? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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, 10:43 PM.

    Comment


    • #3
      Tnx for the answer.

      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.

      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):
      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!

      Comment

      Working...
      X