[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4083) Custom sql-delete does improper parameter handling

ggsoft@gmx.net (JIRA) noreply at atlassian.com
Thu Aug 13 05:34:12 EDT 2009


Custom sql-delete does improper parameter handling
--------------------------------------------------

                 Key: HHH-4083
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4083
             Project: Hibernate Core
          Issue Type: Bug
    Affects Versions: 3.2.6
         Environment: 3.2.6GA, MySQL 5.0.75
            Reporter: ggsoft at gmx.net


With turned on versioning (timestamp)

e.g.
<version name="lastupdated" type="timestamp" />

a custom delete query

<sql-delete>UPDATE myentity SET deleted = 1 WHERE myentityid = ?</sql-delete>

gives an exception on wrong parameter (2 having, only 1 to set)

Hibernate tries to set the version field too so i integrated it to the query:

<sql-delete>UPDATE myentity SET deleted = 1, lastupdated = ? WHERE myentityid = ?</sql-delete>

this gives an exception because hibernate sets lastupdated to the id and myentityid to timestamp in the resulting statement.

(any hint welcome to get it working)

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