-->
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 3 -
PostPosted: Mon Mar 28, 2005 7:22 am 
Newbie

Joined: Tue Nov 04, 2003 7:00 am
Posts: 1
After upgrade from Hibernate 2.1.8 to 3.0 rc1 got the following exception:

Code:
java.lang.UnsupportedOperationException: cannot perform lookups on timestamps
   at org.hibernate.type.TimestampType.getHashCode(TimestampType.java:99)
   at org.hibernate.cache.QueryKey.hashCode(QueryKey.java:76)
   at java.util.HashMap.hash(HashMap.java:261)
   at java.util.HashMap.containsKey(HashMap.java:339)
   at org.apache.commons.collections.SequencedHashMap.containsKey(Unknown Source)
   at org.apache.commons.collections.LRUMap.get(Unknown Source)
   at java.util.Collections$SynchronizedMap.get(Collections.java:1942)
   at net.sf.swarmcache.LRUCache.get(LRUCache.java:119)
   at net.sf.swarmcache.HybridCache.get(HybridCache.java:73)
   at net.sf.swarmcache.MultiCache.get(MultiCache.java:72)
   at gran.tools.cache.QueryCachedSwarmCache.get(QueryCachedSwarmCache.java:33)
   at org.hibernate.cache.StandardQueryCache.get(StandardQueryCache.java:74)
   at org.hibernate.loader.Loader.list(Loader.java:1454)
   at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:111)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1246)
   at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:299)
   at gran.app.filter.PreFilter.addResult(PreFilter.java:294)


Database: HSQL 1.7.2

It seems like it cannot execute the following code:
cr.add(Expression.le(column, new Timestamp(now.getTimeInMillis())));

As mentioned before, this works in 2.1.x


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 28, 2005 9:29 am 
Regular
Regular

Joined: Thu Dec 11, 2003 4:14 pm
Posts: 86
Location: Hibernate 3 + annotations, Oracle 9i, PostgreSQL 8.0, Java 1.5.0
One side-effect of this change is it isnt possible to cache criterias using a timestamp-expression

see: http://forum.hibernate.org/viewtopic.php?t=938289


If possible define of the hibernate types listed here:
http://www.hibernate.org/hib_docs/v3/reference/en/html/mapping.html#mapping-types-basictypes

The only one which is able to handle date AND time beside timestamp is calendar an then you have to use the java-Calendar instead of Date.

Maybe you might have more luck if you create your own UserType.


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.