-->
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: ClassCastException occurs using Set elements sort attribute.
PostPosted: Fri Apr 13, 2007 11:04 am 
Newbie

Joined: Fri Apr 13, 2007 10:58 am
Posts: 10
Hello,

I have strange problem occuring when executing one of my test class in my project.

This is the snippet of Set mapping i am doing in my hibernate mapping file for Category1Category2.java model

<!-- bi-directional one-to-many association to
<set
name="category1category2Assocs"
lazy="false"
inverse="true"
cascade="none"
sort = "com.test.model.Category1Category2Assoc"
>
<key>
<column name="CAT1_CAT2_ID" />
</key>
<one-to-many
class="com.test.model.Category1Category2Assoc"
/>
</set>

Category1Category2Assoc.java and Category1Category2.java are related as mentioned in the mapping file.

When running my tests in Eclipse 3.2 WTP i get a ClassCastException when i iterate over the category1category2Assocs Set in one of my class

On the other hand when i run the same test from commandline i get the results without any errors.

I am using jdk 1.4.2_13

My class com.test.model.Category1Category2Assoc implements the Comparator interface.

So can you people help me rectify where and why the error is occuring..

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 14, 2007 11:06 pm 
Senior
Senior

Joined: Tue Mar 09, 2004 2:38 pm
Posts: 141
Location: Lowell, MA USA
Can you post the stack trace of your exception and the code for com.test.model.Category1Category2Assoc?

Ryan-

_________________
Ryan J. McDonough
http://damnhandy.com

Please remember to rate!


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.