Apologies if I haven't followed this thread closely and what I'm adding doesn't apply, but I found it easier to add helper methods to the VO by adding a parent class (doesn't have to be a parent class). The helper methods in the parent class have the xdoclet tag @ejb.interface-method only, no persist tags.
Then, in the child class that has the persisted fields defined, I added the xdoclet extends option to the value-object tag: * @ejb.value-object * name="MyCode" * match="*" * extends = "com.ingenix.transact.provider.coderepository.ejb.MyCodeData" My child class declaration also extends the parent class: public abstract class MyCodeBean extends MyCodeData implements EntityBean >From that setup, the helper classes get generated in the value object, but aren't persisted. The generated value objects extend the parent class also. I've also found this to be useful for implementing interfaces. For instance, we have an interface that defines getPrimaryKey(). In that case, I added the abstract method getPrimaryKey() in the parent class so the code will compile before the value object is generated. public abstract Integer getPrimaryKey(); /Lorraine -----Original Message----- From: Harkness, David [mailto:[EMAIL PROTECTED] Sent: Monday, May 10, 2004 12:36 PM To: [EMAIL PROTECTED] Subject: RE: [Xdoclet-user] Supressing the Generation of a CMP Value Object? Bruno Beloff wrote: > Now I want to extend the functionality of the VO. Among other > things, I want to add compareTo(..) methods for the VO. You can extend the template used to generate value objects (valueobject.xdt) with code that will create the compareTo method for you. The templates aren't too hard to modify, and the equals method should be a good starting point for you. Alternatively, you can more easily modify the template to include a custom value object merge point *for each class* (the current merge point at the bottom of the file is for a single custom code block for the whole build, not one per bean). This allows you to write plain Java code to be included. You'll of course need to keep your merge files up-to-date with any attribute changes in your beans, but that shouldn't be that bad. If you go the latter route, you just need to insert "-{0}" somewhere in the merge file name. <XDtMerge:merge file="valueobject-custom-{0}.xdt"> ^^^^ David Harkness Sr. Software Engineer Sony Pictures Digital Networks (310) 482-4756 ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
