Lorraine

Thank you, this looks great.

I will try to do this by creating an abstract class which is extended by both the Bean class and the VO. This abstract class can introduce the persisted fields as abstract getters, this allows the compareTo(..) do to its stuff.

This feels slightly weird, because the abstract superclass and the Bean class end up defining the same abstract getter methods. But never mind, because the generated concrete class should guarantee consistency.

Cheers,

Bruno.


On 10 May 2004, at 22:25, Lorraine Fox wrote:


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



------------------------------------------------------- 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

Reply via email to