-->
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: SQLException with hibernate3.1rc1 annotations b6
PostPosted: Mon Oct 10, 2005 8:28 am 
Newbie

Joined: Mon Mar 14, 2005 2:57 pm
Posts: 16
I get SQLExceptions when initializing an indexed collection. The generated sql is correct but the code that reads the result set mistakes the index column as a serializable type.

notice that this used to work with hibernate3.1b3 and annotations b5

The collection mapping is:
@OneToMany( cascade = CascadeType.ALL, mappedBy="node")
@MapKey(name="lang")
@JoinColumn(name="treeid", nullable = false)
protected Map<Language, MetaData> metadata;

and the Language object id is a Long.

Hibernate version:
3.1 rc1

The generated statement
select metadata0_.treeid as treeid2_, metadata0_.id as id2_, metadata0_.langid as formula0_2_, metadata0_.id as id11_1_, metadata0_.langid as langid11_1_, metadata0_.treeid as treeid11_1_, metadata0_.title as title11_1_, metadata0_.description as descript3_11_1_, metadata0_.keywords as keywords11_1_, metadata0_.image as image11_1_, language1_.id as id4_0_, language1_.code as code4_0_, language1_.description as descript3_4_0_, language1_.isDefault as isDefault4_0_ from tmetadata metadata0_ left outer join tlang language1_ on metadata0_.langid=language1_.id where metadata0_.treeid=?

Full stack trace of any exception that occurs:

Caused by: java.sql.SQLException: Unable to convert between java.lang.Integer and BINARY.
at net.sourceforge.jtds.jdbc.Support.convert(Support.java:558)
at net.sourceforge.jtds.jdbc.JtdsResultSet.getBytes(JtdsResultSet.java:714)
at net.sourceforge.jtds.jdbc.JtdsResultSet.getBytes(JtdsResultSet.java:988)
at org.jboss.resource.adapter.jdbc.WrappedResultSet.getBytes(WrappedResultSet.java:238)
at org.hibernate.type.BinaryType.get(BinaryType.java:66)
at org.hibernate.type.SerializableType.get(SerializableType.java:34)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
at org.hibernate.persister.collection.AbstractCollectionPersister.readIndex(AbstractCollectionPersister.java:650)
at org.hibernate.collection.PersistentMap.readFrom(PersistentMap.java:222)
at org.hibernate.loader.Loader.readCollectionElement(Loader.java:994)
at org.hibernate.loader.Loader.readCollectionElements(Loader.java:635)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:579)
at org.hibernate.loader.Loader.doQuery(Loader.java:689)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLa

Name and version of the database you are using:
MS SQL SERVER 2000 sp3
jtds driver version 1.1.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 9:06 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Please send a minimal working testcase and post it to JIRA.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 10:09 am 
Newbie

Joined: Mon Mar 14, 2005 2:57 pm
Posts: 16
I created a bug in jira...

http://opensource2.atlassian.com/projec ... se/ANN-113


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.