-->
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.  [ 6 posts ] 
Author Message
 Post subject: Error in retrieving the value of a "yes_no" column
PostPosted: Tue Apr 20, 2004 8:08 am 
Beginner
Beginner

Joined: Tue Feb 17, 2004 7:53 am
Posts: 24
I have a boolean property , which I have mapped to "yes_no" hibernate type, as then the conversion of booleamn true/false to Y/N happens automatically by Hibernate.
I am able to insert an object using this. But when I retrieve the object , I am getting Invalid Number error. Can anyone please let me know about this.


Hibernate: select catalog_id from CatalogEntry where catalog_id =? for update
Hibernate: select report0_.catalog_id as catalog_id, report0_.definition as definition2_, report0__1_.name as name0_, report0__1_.owner_name as owner_name0_, report0__1_.description as descript4_0_, report0__1_.entry_type as entry_type0_, report0__1_.update_date as update_d6_0_, report0__1_.locale as locale0_, report0__1_.private as private0_ from Report report0_, CatalogEntry report0__1_ where report0_.catalog_id=report0__1_.catalog_id and ((OWNER_NAME=? )and(NAME=? )and(PRIVATE=? ))

| 2004-04-20 17:27:35,952 | ERROR | net.sf.hibernate.util.JDBCExceptionReporter | ORA-01722: invalid number

| 2004-04-20 17:27:35,998 | ERROR | net.sf.hibernate.util.JDBCExceptionReporter | ORA-01722: invalid number

| 2004-04-20 17:27:35,998 | ERROR | net.sf.hibernate.util.JDBCExceptionReporter | Could not execute query
java.sql.SQLException: ORA-01722: invalid number

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:889)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1826)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2015)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:395)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:339)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:179)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:795)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:950)
at net.sf.hibernate.loader.Loader.list(Loader.java:941)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:834)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1512)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at org.springframework.orm.hibernate.HibernateTemplate$19.doInHibernate(HibernateTemplate.java:363)
at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:149)
at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:177)
at org.springframework.orm.hibernate.HibernateTemplate.find(HibernateTemplate.java:356)
at com.aceva.rms.catalog.hibernate.CatalogDAO.findCatalogEntries(CatalogDAO.java:132)


Top
 Profile  
 
 Post subject: Can anyone let me know abt this
PostPosted: Fri Apr 23, 2004 8:48 am 
Beginner
Beginner

Joined: Tue Feb 17, 2004 7:53 am
Posts: 24
Help required


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 23, 2004 6:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Most likely you are passing a boolean as the argument to the HQL parameter when the database is a CHAR. Try passing the 'Y' or 'N' as the argument since this is the underlying database type.


Top
 Profile  
 
 Post subject: Thanks ..Further query
PostPosted: Mon Apr 26, 2004 2:42 am 
Beginner
Beginner

Joined: Tue Feb 17, 2004 7:53 am
Posts: 24
Thanks for the reply. So the user has to take care of this. Dont you think Hibernate would have taken this job and made it transparent to user as it handles at the time of insertion


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 26, 2004 9:44 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/hib_docs/refer ... bstitution

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Tue Apr 27, 2004 4:23 am 
Beginner
Beginner

Joined: Tue Feb 17, 2004 7:53 am
Posts: 24
I wonder how I missed that ..Anyways Thanks Christian.


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