-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Default values for column name in CompositeUserType
PostPosted: Mon Jun 26, 2006 4:37 am 
Newbie

Joined: Mon Jun 26, 2006 3:53 am
Posts: 1
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"/>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.