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