Q: I am new to OJB. I wonder if OJB has something like Hibernate's component mapping, which makes code structure better and reuse easier.
A: Yes that's possible with OJB too! You have to tell OJB to use a PersistentField implementation supporting this in OJB.properties first, as it is not yet implemented in the default implementation:
PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentNestedFieldMaxPerformanceImpl
if your class has an attribute "address" of type Adress, the mapping for the "street" attribute of "address" would look like follows:
{{{ <field-descriptor id="10"
name="adress->street" column="ADR_STREET" jdbc-type="VARCHAR"
/> }}}