[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-2140) SQLQueryParser throws ArrayIndexOutOfBoundsException: -1 for SQL query with join mapped as set of string elements
Artur Jonak (JIRA)
noreply at atlassian.com
Wed Oct 11 06:01:24 EDT 2006
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2140?page=all ]
Artur Jonak updated HHH-2140:
-----------------------------
Attachment: hibernate-testcase.zip
Attached the complete IDEA project containing the test case named: test.sqlquery.SQLQueryTest which reproduces the error. In the test/conf directory thereis also schema.sql along with hibernate and connection properties in test.properties.
Have fun!
> 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: Hibernate3
> Type: Bug
> Components: query-sql
> 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.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list