-->
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.  [ 3 posts ] 
Author Message
 Post subject: Unsupported Operation "cannot perform lookups on timest
PostPosted: Thu Apr 21, 2005 4:37 am 
Newbie

Joined: Wed Apr 20, 2005 11:59 am
Posts: 1
Hi all,

I try to access a table, which has a Date as it's primary key and get an UnsupportedOperationException. I've seen in the code that the implementation of the getHashCode() method in TimestampType throws this exception. Why's that? Is it going to be changed? For now I had no choice than to go via JDBC but obviously I'd prefer to do everything via Hibernate!

Thank you,
Jan


Top
 Profile  
 
 Post subject: Same problem (cannot perform lookups on timestamps)
PostPosted: Thu Apr 21, 2005 12:30 pm 
Newbie

Joined: Thu Apr 21, 2005 12:20 pm
Posts: 4
We have a database (DB2 OS/390 v.7.1.2) with a table with a DB2-timestamp as primary key. The mapping configuration seems to work withhout protests, but trying to actually get some data from the table returns this:

Exception in thread "main" java.lang.UnsupportedOperationException: cannot perform lookups on timestamps
at org.hibernate.type.TimestampType.getHashCode(TimestampType.java:99)
at org.hibernate.type.AbstractType.getHashCode(AbstractType.java:119)
at org.hibernate.engine.EntityKey.getHashCode(EntityKey.java:68)
at org.hibernate.engine.EntityKey.<init>(EntityKey.java:41)
at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:705)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:280)
at org.hibernate.loader.Loader.doQuery(Loader.java:387)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:206)
at org.hibernate.loader.Loader.doList(Loader.java:1515)
at org.hibernate.loader.Loader.list(Loader.java:1498)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:111)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1253)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:299)
at storebrand.overvaakning.dbaccess.TestHibernate.main(TestHibernate.java:40)

Couldn't find any doc on this exception, so I'm kind of lost here...

My mapping file:

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="storebrand.overvaakning.data.Hendelse" table="M3.DRIFTSSTATUS">
<id name="timestamp" type="timestamp">
<column name="DRIFTSSTATUS_TMS" />
</id>
<property name="feilmelding">
<column name="FEILMELDING_TXT" />
</property>
<property name="status">
<column name="DRIFTSSTATUS_KDE" />
</property>
<property name="responseTime">
<column name="SVAR_TID" />
</property>
<many-to-one name="system2SystemKjede" insert="false" update="false" lazy="false">
<column name="SYSTEMKJEDE_NVN" />
<column name="SYSTEM_NVN" />
</many-to-one>
</class>
</hibernate-mapping>


Morten Simonsen


Top
 Profile  
 
 Post subject: Please refer to another entry
PostPosted: Fri Apr 22, 2005 5:55 am 
Newbie

Joined: Fri Apr 22, 2005 4:33 am
Posts: 9
http://forum.hibernate.org/viewtopic.php?p=2239206


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.