| org.kuali.module.financial.dao.ojb.PolymorphicMultiColumnDiscriminator
PolymorphicMultiColumnDiscriminator | abstract public class PolymorphicMultiColumnDiscriminator extends RowReaderDefaultImpl (Code) | | (Inspired by example posted at http://nagoya.apache.org/eyebrowse/ReadMsg?listName=ojb-user@db.apache.org&msgId=749837) This
class enables mapping multiple (presumably similar) classes to a single database table. Subclasses must implement the
getDiscriminatorColumns method, returning a String array of columns to consider when determining which class to return, as well
as implement the corresponding chooseClass method that acts on received values for those columns. Sample OBJ config:
...
... (where ClassADiscriminator and ClassBDiscriminator
extend PolymorphicMultiColumnDiscriminator)
|
PolymorphicMultiColumnDiscriminator | public PolymorphicMultiColumnDiscriminator(ClassDescriptor cld)(Code) | | |
chooseClass | abstract public Class chooseClass(String[] values)(Code) | | Based on the received key values, this method determines the appropriate class.
Parameters: values - an appropriately chosen class |
getDiscriminatorColumns | abstract public String[] getDiscriminatorColumns()(Code) | | This method should return the column(s) necessary to determine which class to cast to.
one or more column names |
selectClassDescriptor | protected ClassDescriptor selectClassDescriptor(Map row) throws PersistenceBrokerException(Code) | | |
|
|