-->
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: Need to save value type object into a separate table
PostPosted: Fri Oct 06, 2006 5:56 pm 
Newbie

Joined: Thu Aug 17, 2006 10:18 am
Posts: 9
We have an object that contains value types and we'd like to save these value types in a separate table with the life cycle of those value types being controlled by the main table, in other words there is no primary key for the value type table. We tried the composite element for the set to specify the value type and the table name was given as part of the set element. When we tried to save this we were getting a ClassCastException and Hibernate would'nt tell us what we were doing wrong. Has anyone faced a similar problem before, is so can you share your inputs here, are we doing the right thing as far as dealing with value types ?

<set name="dueDateRanges" inverse="false" lazy="false" cascade="all" table="CriteriaDueDateRanges">
<key column ="criteriaID" not-null="true" />
<composite-element class="DateRange">
<property name="startDate" column="startdate"/>
<property name="endDate" column="enddate"/>
</composite-element>
</set>

In the above configuration the DateRange table is the value type that we want saved in CriteriaDueDateRanges.


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.