[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-1774) Component parameters bound incorrectly

Steve Ebersole (JIRA) noreply at atlassian.com
Wed Oct 18 23:30:25 EDT 2006


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1774?page=all ]
     
Steve Ebersole resolved HHH-1774:
---------------------------------

    Resolution: Fixed

See org.hibernate.test.hql.ASTParserLoadingTest#testComponentParameterBinding

> Component parameters bound incorrectly
> --------------------------------------
>
>          Key: HHH-1774
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1774
>      Project: Hibernate3
>         Type: Bug

>   Components: query-hql
>  Environment: Hibernate 3.1.3 / 3.2.0 cr1 / 3.2.9 cr2
> Database: PostgreSQL 8.0 and Oracle 7.3.4
>     Reporter: Regis Pires Magalhaes
>     Assignee: Steve Ebersole
>      Fix For: 3.2.1
>  Attachments: CompositeIdTest.java
>
>
> Hibernate is generating a wrong SQL related to a composite-id HQL.
> The details of the problem are described below...
> MAPPING:
> <hibernate-mapping>
>     <class name="Cobrador" table="cobrador">
>    <composite-id name="id" class="CobradorId">
>       <key-property name="empresa"/>
>       <key-property name="matricula"/>
>    </composite-id>
>         <property name="nome" type="string"/>
>     </class>
> </hibernate-mapping>
> HQL:
> from Cobrador cobrador
> where cobrador = :cobrador
> GENERATED SQL:
> select cobrador0_.empresa as empresa3_,
>        cobrador0_.matricula as matricula3_,
>        cobrador0_.nome as nome3_,
> from cobrador cobrador0_
> where (cobrador0_.empresa, cobrador0_.matricula)=?
> PARAMETERS BINDING:
> DEBUG 13/05/2006 10:32:18 [org.hibernate.type.IntegerType:80] - binding '1' to parameter: 1
> DEBUG 13/05/2006 10:32:18 [org.hibernate.type.IntegerType:80] - binding '1234' to parameter: 2
> Note that 2 parameters are binded, but there is just a single parameter in the generated SQL.
> DATABASE EXCEPTION:
> org.postgresql.util.PSQLException: The column index is out of range: 2, number of columns: 1
> The generated SQL should be:
> select cobrador0_.empresa as empresa3_,
>        cobrador0_.matricula as matricula3_,
>        cobrador0_.nome as nome3_,
> from cobrador cobrador0_
> where (cobrador0_.empresa, cobrador0_.matricula)=(?, ?)

-- 
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