I have a model like this:

BusinessObject --> AuditableBusinessObject -- > Dog

Dog extends AuditableBusinessObject -- along with 30 or so other classes,
while 15 or so only extend BusinessObject.

AuditableBusinessObject's all have created/modified/deleted dates, and are
never deleted, but only 'soft' deleted -- where the deleted date is set, but
the record is not removed from the db -- and any retrieves from the database
need to filter these out. The AuditableBusinessObject class has no
corresponding table's -- all it is adding is references to 3 fields that are
in the subclasses tables.

Well, I have written my own RowReader to filter these out, and it works
great when I put this in the class comments for my subclass, like the
following:

/**
 * @ojb.class   table="tbl_dog"
 *                      include-inherited="true"
 *                      row-reader="org.foo.ojb.RowReaderFilterDeletedImpl"
 *  
 */
public class Dog extends AuditableBusinessObject


Now, I would like to make it so that all classes that extend
AuditableBusinessObject automatically get this row-reader, and I don't need
to set it in the individual sub-classes. I would assume something like this
would work, but it doesn't:


/**
 * @ojb.class   row-reader="org.foo.ojb.RowReaderFilterDeletedImpl"
 *                        
 */
public class AuditableBusinessObject extends BusinessObject
{}

/**
 * @ojb.class   table="tbl_dog"
 *                      include-inherited="true"
 *  
 */
public class Dog extends AuditableBusinessObject
{}

When doing this, it will create an entry in my repositrory_user.xml for
AuditableBusinessObject with the row-reader set, the default table name
(doesn't matter since not table exist for that and we don't read from a
table for ABO), and the extends for it. However, it *does not* place the
row-reader attribute in the class descriptor comment for my Dog class --
thus making my Dog class to load using the default row-reader, and not my
custom one.

Is there a way to do this, or am I asking for too much? Or, is my design
wrong, and I *should* specify the row-reader in each class?

Thanks!
-Andrew

Reply via email to