[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-1595) SQL syntax error on delete statement with subselect

Strong Liu (JIRA) noreply at atlassian.com
Mon Apr 19 02:11:20 EDT 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Strong Liu resolved HHH-1595.
-----------------------------

    Resolution: Incomplete

> SQL syntax error on delete statement with subselect
> ---------------------------------------------------
>
>                 Key: HHH-1595
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1595
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: query-hql
>    Affects Versions: 3.1.3
>         Environment: Hibernate 3.1.3, Oracle 10g
>            Reporter: Georgios Skempes
>            Assignee: Strong Liu
>
> After upgrading from Hibernate 3.1.2 to 3.1.3 I get an SQL syntax error for the HQL statement below. It's a bulk delete containing a subselect. The code is working for Hibernate 3.1.2
> Code between session.open() and session.close():
> ------------------------------------------------------------------------
> String queryString = "delete from Contact con where con.Id.ConpId IN (select conp.Id from con.ContactpersonSet conp where conp.ParId=4711)
> Query queryObject = session.createQuery(queryString);
> queryObject.executeUpdate();
> SQL code generated with Hibernate 3.1.2 (correct):
> ----------------------------------------------------------------------
> delete from CONTACTS where CONP_ID in (select contactper1_.Id from CONTACTPERSONS contactper1_ where CONP_ID=contactper1_.Id and PAR_ID=4711)
> SQL code generated with Hibernate 3.1.3 (error):
> -----------------------------------------------------------------------
> delete from CONTACTS where CONP_ID in (select contactper1_.Id from CONTAKTPERSONS contactper1_ where contact0_.CONP_ID=contactper1_.Id and contactper1_.PAR_ID=?)
> Error log:
> -----------------------------------------------------------------------
> [08:43:01,591] (ERROR) org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:72) - ORA-00904: "CONTACT0_"."CONP_ID": invalid identifier

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