Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Hibernate
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Hibernate section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 10th, 2008, 11:18 AM
Registered User
Join Date: Jan 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hibernate Spring and HSQLDB Error

 Hi I am using Spring with Hibernates and HSQLDB for Unit testing. Unfortunately I am getting error in the following function,
return sessionFactory.getCurrentSession().createQuery(" from Quest Q where Q.availableFrom > CURRENT_DATE").list();

Error is following

Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.725 sec <<< FAILURE!
testFindAll(com.playdo.spineworld.dao.QuestReposit oryHibImplTest) Time elapsed: 0.231 sec <<< ERROR!
org.hibernate.exception.SQLGrammarException: could not execute query
        at org.hibernate.exception.SQLStateConverter.convert( SQLStateConverter.java:67)
        at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:43)
        at org.hibernate.loader.Loader.doList(Loader.java:222 3)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(L oader.java:2104)
        at org.hibernate.loader.Loader.list(Loader.java:2099)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoa der.java:378)
        at org.hibernate.hql.ast.QueryTranslatorImpl.list(Que ryTranslatorImpl.java:338)
        at org.hibernate.engine.query.HQLQueryPlan.performLis t(HQLQueryPlan.java:172)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.ja va:1121)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:7 9)
        at com.playdo.spineworld.dao.QuestRepositoryHibImpl.f indAll(QuestRepositoryHibImpl.java:35)
        at com.playdo.spineworld.dao.QuestRepositoryHibImplTe st.testFindAll(QuestRepositoryHibImplTest.java:145 )
Caused by: java.sql.SQLException: Column not found: CURRENT_DATE in statement [select quest0_.id as id94_, quest0_.active as active94_, quest0_.availableFrom as availabl3_94_, quest0_.availableTo as availabl4_94_, quest0_.completedTimes as complete5_94_, quest0_.cooldown as cooldown94_, quest0_.lastCompleted as lastComp7_94_, quest0_.name as name94_, quest0_.questAcceptor as questAcc9_94_, quest0_.questGiver as questGiver94_, quest0_.questItem as questItem94_, quest0_.repeatable as repeatable94_ from Quest quest0_ where quest0_.availableFrom>CURRENT_DATE]
        at org.hsqldb.k.do(Unknown Source)
        at org.hsqldb.q.<init>(Unknown Source)
        at org.hsqldb.ag.do(Unknown Source)
        at org.hsqldb.ag.int(Unknown Source)
        at org.hsqldb.t.a(Unknown Source)
        at org.hsqldb.t.executeQuery(Unknown Source)
        at org.hsqldb.r.executeQuery(Unknown Source)
        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement .executeQuery(NewProxyPreparedStatement.java:76)
        at org.hibernate.jdbc.AbstractBatcher.getResultSet(Ab stractBatcher.java:186)
        at org.hibernate.loader.Loader.getResultSet(Loader.ja va:1787)
        at org.hibernate.loader.Loader.doQuery(Loader.java:67 4)
        at org.hibernate.loader.Loader.doQueryAndInitializeNo nLazyCollections(Loader.java:236)
        at org.hibernate.loader.Loader.doList(Loader.java:222 0)
        ... 45 more

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL hibernate connection error kadimijagan Hibernate 2 May 11th, 2009 06:31 AM
Using HSQLDB database for container authentication remmons Apache Tomcat 3 September 4th, 2007 09:06 AM
Hibernate Error :javax/transaction/Synchronization orange_jhon Hibernate 0 August 7th, 2007 03:46 AM
Error while invoking stored procedure in hibernate avinash_thm Hibernate 5 April 25th, 2007 03:46 AM
WSAD error while running Hibernate Project sun_ice Hibernate 0 January 2nd, 2006 09:44 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.