-->
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: Hibernate Search ClassCastException
PostPosted: Wed Jan 24, 2007 4:27 pm 
Newbie

Joined: Tue Jan 02, 2007 5:26 am
Posts: 7
Location: London
Hi,

I'm trying to run a search using the Restrictions class on an Oracle 9i database.

I'm creating 2 timestamps for start and end dates and creating Restrictions in the search Criteria in the form of

searchCriteria.
add(Restriction.ge(startStamp));
add(Restriction.ge(endStamp));

This however gives me a ClassCastException

Caused by: java.lang.ClassCastException: java.sql.Timestamp

at com.bt.orsim.services.BusinessMessageManager.getBusinessMessagesByFilter(BusinessMessageManager.java:409)

Please is there anyone who can help me with this problem? I am able to provide more information if required however my project is highly sensitive.

Thanks


Top
 Profile  
 
 Post subject: Fixed
PostPosted: Thu Jan 25, 2007 8:58 am 
Newbie

Joined: Tue Jan 02, 2007 5:26 am
Posts: 7
Location: London
Hi all,

No bother, I've fixed the problem.

It was coming from a dynamically loaded HashMap of the type

HasMap <String><Object> map;

what happened was i forgot to typecast the timestamp back to type timestamp in the Restrictions.

ie
...Restriction.ge("key", (Timestamp)timestampObject);

This fixed the problem.


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.