-->
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: Eq problem, expected clob.
PostPosted: Mon Dec 31, 2007 5:17 am 
Newbie

Joined: Mon Dec 31, 2007 4:59 am
Posts: 2
Hi all I have a problem doing the operation Restrictions.eq("property", value). The property is of type "text" and the value that hold the column is Base64 String that representa a Hash Code. I´m trying get the object "Documento" doing an "eq" to the properties of the Object but I get the ORA-00932 error. What I´m doing wrong? Any ideas?. Thanks in advance, and happy new year.

Hibernate version: 3.1.3

The mapping files:

<hibernate-mapping package="com.interoperatividad.registroentradasalida">
<class name="Documento" table="documento">

<id name="id" type="long">
<generator class="native"/>
</id>

<property name="documentoPk" type="string" not-null="true"/>
<property name="hash" type="text" not-null="true"/>
</class>
</hibernate-mapping>

Full stack trace of any exception that occurs:
DEBUG [org.hibernate.util.JDBCExceptionReporter] could not execute query [select this_.id as id14_0_, this_.documentoPk as document2_14_0_, this_.hash as hash14_0_ from documento this_ where this_.documentoPk=? and this_.hash=?]
java.sql.SQLException: ORA-00932: inconsistent datatypes: expected - got CLOB

oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:810)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:850)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3384)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1668)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2144)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
at org.hibernate.loader.Loader.list(Loader.java:2023)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:305)

Name and version of the database you are using: Oracle 10g

The generated SQL (show_sql=true):

2007-12-26 07:41:18,876 INFO [STDOUT] Hibernate:
select
this_.id as id14_0_,
this_.documentoPk as document2_14_0_,
this_.hash as hash14_0_
from
documento this_
where
this_.documentoPk=?
and this_.hash=?


Top
 Profile  
 
 Post subject: Raw type
PostPosted: Mon Dec 31, 2007 8:11 am 
Newbie

Joined: Mon Dec 31, 2007 4:59 am
Posts: 2
I changeg the type of "hash" now is of type binary, that is modeled in Oracle 10g like a raw type. But I get the same error, I don´t know if Hibernate can execute a Restriction.eq(property, value) and the value argument being a byte[]. Any ideas? Thanks in advance.


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.