[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2140?page=c...
]
Gus Heck commented on HHH-2140:
-------------------------------
I got this stack trace also... when our spring config tried to load up hibernate with
this query... if I remove the query (and the collection I am mapping to it) things are
fine... (there were where clauses to filter it to open issues, but I removed them trying
to get *something* to work, with no success).
<sql-query name="loadOpenIssues">
<load-collection alias="x" role="Shipment.openIssues"/>
select
{x.*}
from Issue
where shipmentRefNum=:shipmentReference
</sql-query>
SQLQueryParser throws ArrayIndexOutOfBoundsException: -1 for SQL
query with join mapped as set of string elements
-----------------------------------------------------------------------------------------------------------------
Key: HHH-2140
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2140
Project: Hibernate Core
Issue Type: Bug
Components: query-sql
Affects Versions: 3.1.3
Reporter: Artur Jonak
Attachments: hibernate-testcase.zip
I have the following mapping:
<class name="GCPSimpleDocumentImpl" table="GCP_Node"
mutable="false">
<id name="DocumentId" />
...
<set name="ApplicationAreas" table="GCP_ApplicationArea"
cascade="none" order-by="Name" sort="natural"
mutable="false">
<key column="DocumentId"/>
<element type="string" column="Name"/>
</set>
</class>
and I try to run an SQL query:
List result = session.createSQLQuery(
"select distinct {node.*}, {areas.*} from GCP_Node node join GCP_ApplicationArea
areas on node.DocumentId=areas.DocumentId " +
"where areas.Name like 'BS - CF%'")
.addEntity("node", GCPSimpleDocumentImpl.class)
.addJoin("areas", "node.ApplicationAreas")
.list();
Unfortunately I get the following exception:
java.lang.ArrayIndexOutOfBoundsException: -1
at
org.hibernate.loader.custom.SQLQueryParser.substituteBrackets(SQLQueryParser.java:133)
at org.hibernate.loader.custom.SQLQueryParser.process(SQLQueryParser.java:85)
at org.hibernate.loader.custom.SQLCustomQuery.<init>(SQLCustomQuery.java:157)
at
org.hibernate.engine.query.NativeSQLQueryPlan.<init>(NativeSQLQueryPlan.java:20)
at
org.hibernate.engine.query.QueryPlanCache.getNativeSQLQueryPlan(QueryPlanCache.java:113)
at
org.hibernate.impl.AbstractSessionImpl.getNativeSQLQueryPlan(AbstractSessionImpl.java:137)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:164)
...
--
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