From: <leg...@at...> - 2004-01-02 23:43:28
|
The following issue has been updated: Updater: Michael Gloegl (mailto:gl...@ok...) Date: Fri, 2 Jan 2004 5:43 PM Comment: Explicit generation of brackets in NotExpression Changes: Attachment changed to notExpression_Brackets.patch --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-597&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-597 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-597 Summary: Criteria API - NOT IN not working on MySQL Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1.1 Assignee: Reporter: Michael Gloegl Created: Fri, 2 Jan 2004 5:42 PM Updated: Fri, 2 Jan 2004 5:43 PM Environment: Hibernate 2.1.1, MySQL Description: On MySQL the SQL generated by a Criteria query like Object o = session .createCriteria(Event.class) .add(Expression.not(Expression.in("id", id_values))) .uniqueResult(); does not work. Hibernate generates a SQL like SELECT * FROM Event WHERE NOT id IN ( 1, 2, 3, 4, 5 ) This should work, but MySQL does not get the operator precedences right. This works by using explicit brackets, or by placing the NOT after the column name. I attatch some possible patches to fix this. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |