From: Josh M. (JIRA) <no...@at...> - 2006-07-21 20:06:13
|
filter condition "(:param = true)" fails since "true" is parsed as this_.true ------------------------------------------------------------------------------- Key: HHH-1932 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1932 Project: Hibernate3 Type: Bug Components: query-criteria Versions: 3.2.0.cr2 Environment: Hibernate 3.2.cr2 AND URL: http://anonhibernate.labs.jboss.com/trunk/Hibernate3 Revision: 10132 Reporter: Josh Moore Attachments: DynamicFilterTest.java, Product.hbm.xml, defs.hbm.xml A filter of the form (see attached defs.hbm.xml): <filter-def name="isOwner" condition=" ( :isOwner = true ) "> <filter-param name="isOwner" type="java.lang.Boolean"/> </filter-def> fails with the following exception thrown from attached testcase (modified DynamicFilterTest) : org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2147) 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) at org.hibernate.test.filter.DynamicFilterTest.testBooleanFilterOnCriteria(DynamicFilterTest.java:441) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at org.hibernate.test.TestCase.runTest(TestCase.java:162) at junit.framework.TestCase.runBare(TestCase.java:127) at org.hibernate.test.TestCase.runBare(TestCase.java:401) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: java.sql.SQLException: Column not found: THIS_.TRUE in statement [select this_.PROD_ID as PROD1_2_1_, this_.name as name2_1_, this_.STOCK_NUM as STOCK3_2_1_, this_.eff_start_dt as eff4_2_1_, this_.eff_end_dt as eff5_2_1_, categories2_.PROD_ID as PROD1_3_, category3_.CAT_ID as CAT2_3_, category3_.CAT_ID as CAT1_6_0_, category3_.name as name6_0_, category3_.eff_start_dt as eff3_6_0_, category3_.eff_end_dt as eff4_6_0_ from PRODUCT this_ left outer join PROD_CAT categories2_ on this_.PROD_ID=categories2_.PROD_ID left outer join CATEGORY category3_ on categories2_.CAT_ID=category3_.CAT_ID where ( ? = this_.true ) and this_.PROD_ID=?] at org.hsqldb.jdbc.Util.throwError(Unknown Source) at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source) at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:497) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:415) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561) at org.hibernate.loader.Loader.doQuery(Loader.java:661) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2144) ... 27 more -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |