[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1830?page=c...
]
Marius Capris commented on HHH-1830:
------------------------------------
Hi all,
i had the same Exception and after hours of testing i found the reason. The problem is
caused by the HQL-functions like elements() ,size() ... It seems that this ones expect the
complete path.
e.g. Replace in the present case: ..."ELEMENTS(bs)" with
"ELEMENTS(a.bs)" and it will run (if you also fix the "the layer 8
problem" replace "b.c.s" with "b.c.value" )
Regards
Marius Capris
Error during parse query on MS SQL
----------------------------------
Key: HHH-1830
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1830
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.1.2, 3.2.0.cr2
Environment: Microsoft SQL Server 2000, Windows XP, JDK 1.5 Update 4
Reporter: Den Raskovalov
Assignee: Steve Ebersole
Attachments: hibernateBug.tar.gz, hibernateBug.zip
HQL: select deal, items.dateBegin, client.Title from " + CoreDeal.class.getName() +
" deal left join deal.stagesWorkflowInstance.history.items items, " +
CoreClient.class.getName() + " client where stageResponsible=:stageResponsible and
items.index=maxindex(items) and deal.parent=client and
deal.stagesWorkflowInstance.Stage.showOnPersonalPage=1
It works normally on Oracle, but on MS SQL produces:
Error: String index out of range: -5
[java.lang.StringIndexOutOfBoundsException]
java.lang.String.substring(String.java:1768)
java.lang.String.substring(String.java:1735)
org.hibernate.hql.CollectionSubqueryFactory.createCollectionSubquery(CollectionSubqueryFactory.java:32)
org.hibernate.hql.ast.tree.FromElementType.toColumns(FromElementType.java:301)
org.hibernate.hql.ast.tree.FromElementType.toColumns(FromElementType.java:291)
org.hibernate.hql.ast.tree.FromElement.toColumns(FromElement.java:377)
org.hibernate.hql.ast.tree.MethodNode.resolveCollectionProperty(MethodNode.java:115)
org.hibernate.hql.ast.tree.MethodNode.collectionProperty(MethodNode.java:95)
org.hibernate.hql.ast.tree.MethodNode.resolve(MethodNode.java:44)
org.hibernate.hql.ast.HqlSqlWalker.processFunction(HqlSqlWalker.java:844)
org.hibernate.hql.antlr.HqlSqlBaseWalker.functionCall(HqlSqlBaseWalker.java:2324)
org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1285)
org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4032)
org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3521)
org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1758)
org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1686)
org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1683)
org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1683)
org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:776)
org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:577)
org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:227)
org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:159)
org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:110)
org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:77)
org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:56)
org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1612)
ru.naumen.crm2.bobjects.deal.CoreDealHibernateHandler.listAllDealsWithSortDataByResponsible(CoreDealHibernateHandler.java:109)
ru.naumen.crm2.ui.tlc.CoreEmployeeTableListController.listMyDealsSorted(CoreEmployeeTableListController.java:70)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira