In our domain model most of the domain objects have columns for audit logging. And they all have same name
createdBy
createdDate
updaedBy
updatedDate
And we map them as component in our hbm files to a class say TransactionInfo
<component
class="example.common.domain.TransactionInfo" name="transactionInfo">
<property column="LAST_UPDATED_BY" name="updatedBy" type="string"/>
<property column="LAST_UPDATE_DATE" name="updatedDate" type="date"/>
<property column="CREATED_BY" name="createdBy" type="string"/>
<property column="CREATE_DATE" name="createdDate" type="date"/>
</component>
And this piece of mapping is repeated everywhere. Now if we change it to use compositeUserType then it simplifies to
<property name="transactionInfo"
type="example.common.domain.TransactionInfoType">
<column name="CREATED_BY"/>
<column name="CREATE_DATE"/>
<column name="LAST_UPDATED_BY"/>
<column name="LAST_UPDATE_DATE"/>
</property>
Still I have to give same column name everywhere. Cannot I have a way to define the default name then I would be able to simplify the ampping further to
<property name="transactionInfo"
type="example.common.domain.TransactionInfoType"/>