-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to assign default value to a property
PostPosted: Wed Feb 27, 2008 10:23 am 
Newbie

Joined: Tue Aug 21, 2007 12:36 am
Posts: 6
Hibernate version: 3.2.4

Mapping documents:

Code:
<hibernate-mapping>
   <class name="com.doubleclick.dart.boom.model.impl.BoomListParametersImpl" table="BOOM_LIST_PARAMETERS">

      <id name="id" type="long" column="LIST_ID" unsaved-value="undefined">
         <generator class="foreign">
            <param name="property">userListDtImpl</param>
         </generator>
      </id>
      
      <one-to-one name="userListDtImpl" class="com.doubleclick.dart.boom.model.impl.UserListDtImpl" constrained="true"/>

      <property name="src" column="SRC" type="string" not-null="false"
         length="100" />

      <property name="dcnet" column="DCNET" type="string"
         not-null="false" length="100" />

      <property name="boom" column="BOOM" type="string"
         not-null="false" length="300" />

         </class>
</hibernate-mapping>


In the above mapping I want hibernate to assign same value as of ID property to BOOM property while saving the object.

Can you please suggest how can I acheive this?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 27, 2008 10:55 am 
Newbie

Joined: Fri Jan 16, 2004 9:59 am
Posts: 18
Location: La Plata-Argentina / Luxembourg
one alternative could be a custion IdentifierGenerator ... may be not the best


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

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.