This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Roo addon managing multiple ITD files?

Jan 3rd, 2011, 08:27 PM

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

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.

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.