Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HibernateException while using native sql query

 
R Babu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to Hibernate. I am facing a problem with deleting a row from the table. Though the deletion happens I can see an exception being thrown in the console which is given below.

Exception occurred...org.hibernate.HibernateException: Exception while trying to autodiscover types.


I am using the Spring framework's hibernate support and using the HibernateTemplate's findByNamedQuery method, I am calling the named native SQL query to delete a row from the table.




Kindly help me understand the cause for this exception so that I could fix it.

Thanks,
Babu
 
R Babu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the stack trace. Please help me..

org.hibernate.HibernateException: Exception while trying to autodiscover types.
at org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoad
er.java:153)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1678)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo
ader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2145)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:111)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1655)

at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:
142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:164)
at org.springframework.orm.hibernate3.HibernateTemplate$34.doInHibernate
(HibernateTemplate.java:920)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(Hibernat
eTemplate.java:366)
at org.springframework.orm.hibernate3.HibernateTemplate.findByNamedQuery
(HibernateTemplate.java:911)


Thanks,
Babu
 
sarmaP lolla
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Babu,

What did you define for PRODUCT_CODE = ? AND CODE_TYPE_ID= ? Can you pose more of your PRODUCT class?

Sarma
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic