[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2149?page=c...
]
Diego Pires Plentz resolved HHH-2149.
-------------------------------------
Assignee: Diego Pires Plentz
Resolution: Duplicate
Wrong SQL generated with delete HQL
-----------------------------------
Key: HHH-2149
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2149
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.1.3
Environment: Hibernate version 3.1.3
oracle version 9
Reporter: jeremie balcaen
Assignee: Diego Pires Plentz
Priority: Minor
Here is the delete HQL statement :
delete Label label where label.numseq = '01' and label.codlan =
'01'" and label.mytad.argtbl = 'BE' and label.mytad.numbtl =
'054'
The generated SQL is :
delete from JPRG.LABEL, MYTAD mytad1_ where NUMSEQ='01' and CODLAN='01'
and ARGTBL='BE' and NUMBTL='054'
Here are the mapping files :
<hibernate-mapping package="com.cwsoft.businessobject">
<class name="Label" table="LABEL" >
<composite-id>
<key-many-to-one name="mytad">
<column name="NUMBTL"/>
<column name="ARGTBL"/>
</key-many-to-one>
<key-property name="numseq" type="string">
<column name="NUMSEQ"/>
</key-property>
<key-property name="codlan" type="string">
<column name="CODLAN"/>
</key-property>
</composite-id>
<property name="labele" column="LABELE"
type="string" not-null="true" />
</class>
</hibernate-mapping>
The associated class is defined with a composite-id : (with id, it works fine)
<hibernate-mapping package="com.cwsoft.businessobject">
<class name="Mytad" table="MYTAD">
<composite-id>
<key-property name="numbtl" type="string">
<column name="NUMBTL"/>
</key-property>
<key-property name="argtbl" type="string">
<column name="ARGTBL"/>
</key-property>
</composite-id>
<property name="thdesc" type="string"
column="THDESC"/>
</class>
</hibernate-mapping>
--
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