[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-1080) HQL delete fails on entities with where-fragments using operators other than '='
Steve Ebersole (JIRA)
noreply at atlassian.com
Mon Mar 21 13:00:40 EDT 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1080?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steve Ebersole closed HHH-1080.
-------------------------------
Closing stale resolved issues
> HQL delete fails on entities with where-fragments using operators other than '='
> --------------------------------------------------------------------------------
>
> Key: HHH-1080
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1080
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1 rc 1, 3.1 rc2
> Environment: Hibernate v3.1rc2, HSQLDB1.7.3.3
> Reporter: Kemal Erdogan
> Assignee: Steve Ebersole
> Fix For: 3.1 rc3
>
>
> The 3rd line of the following snippet fails to execute and creates a java.lang.StringIndexOutOfBoundsException:
> s.createQuery("delete from Bar").executeUpdate();
> s.createQuery("delete from Baz").executeUpdate();
> s.createQuery("delete from Foo").executeUpdate();
> It is the "org.hibernate.test.Foo" Bar and Baz under Hibernate test suite. I used the paremeters and settings under /etc folder of Hibernate distribution.
> I just addes these 3 lines to the top of org.hibernate.test.legacy.FooBarTest.testQuery()
> s.createQuery("delete from Bar").executeUpdate();
> s.createQuery("delete from Baz").executeUpdate();
> s.createQuery("delete from Foo").executeUpdate();
> Here is the stack trace:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> at java.lang.String.substring(Unknown Source)
> at org.hibernate.hql.ast.util.SyntheticAndFactory.parseEqFragmentToSubtree(SyntheticAndFactory.java:135)
> at org.hibernate.hql.ast.util.SyntheticAndFactory.addDiscriminatorWhereFragment(SyntheticAndFactory.java:119)
> at org.hibernate.hql.ast.HqlSqlWalker.postProcessDML(HqlSqlWalker.java:507)
> at org.hibernate.hql.ast.HqlSqlWalker.postProcessDelete(HqlSqlWalker.java:524)
> at org.hibernate.hql.antlr.HqlSqlBaseWalker.deleteStatement(HqlSqlBaseWalker.java:446)
> at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:245)
> at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:216)
> at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:156)
> at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:103)
> at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:473)
> at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1060)
> at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1041)
> at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:89)
> at org.hibernate.test.legacy.FooBarTest.testQuery(FooBarTest.java:337)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at org.hibernate.test.TestCase.runTest(TestCase.java:140)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> 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.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
--
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
More information about the hibernate-issues
mailing list