Return-Path: X-Original-To: apmail-metamodel-dev-archive@minotaur.apache.org Delivered-To: apmail-metamodel-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 583BC17C27 for ; Fri, 7 Nov 2014 14:20:07 +0000 (UTC) Received: (qmail 37704 invoked by uid 500); 7 Nov 2014 14:20:07 -0000 Delivered-To: apmail-metamodel-dev-archive@metamodel.apache.org Received: (qmail 37665 invoked by uid 500); 7 Nov 2014 14:20:07 -0000 Mailing-List: contact dev-help@metamodel.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@metamodel.incubator.apache.org Delivered-To: mailing list dev@metamodel.incubator.apache.org Received: (qmail 37650 invoked by uid 99); 7 Nov 2014 14:20:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Nov 2014 14:20:07 +0000 X-ASF-Spam-Status: No, hits=-2000.6 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 07 Nov 2014 14:19:44 +0000 Received: (qmail 36974 invoked by uid 99); 7 Nov 2014 14:19:42 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Nov 2014 14:19:42 +0000 Date: Fri, 7 Nov 2014 14:19:42 +0000 (UTC) From: =?utf-8?Q?Dennis_Du_Kr=C3=B8ger_=28JIRA=29?= To: dev@metamodel.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (METAMODEL-85) isNull() uses = instead of IS NULL in SQL update query MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/METAMODEL-85?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D14= 202082#comment-14202082 ]=20 Dennis Du Kr=C3=B8ger commented on METAMODEL-85: ------------------------------------------- That is just my example being badly recreated. The statement was certainly = run, as we saw the generated SQL do the "WHERE x =3D NULL". We talked about it at the time, and I think we reached the conclusion that = it works as it should for SELECT statements, but not for UPDATE statements.= The fix you remember may have been for SELECT? > isNull() uses =3D instead of IS NULL in SQL update query=20 > ------------------------------------------------------- > > Key: METAMODEL-85 > URL: https://issues.apache.org/jira/browse/METAMODEL-85 > Project: Metamodel > Issue Type: Bug > Affects Versions: 4.2.0-incubating > Environment: JDK 8 on Windows 7 > Reporter: Dennis Du Kr=C3=B8ger > > An update statement with a isNull() should with a JdbcDataContext transla= te to WHERE hello IS NULL, but instead translates to "WHERE hello =3D NULL"= , which does not work as intended, since NULL in SQL is never equal to anyt= hing, even other NULLs. > {code} > private void testCode(){ > _dataContext.executeUpdate(new UpdateScript() { =20 > @Override > public void run(UpdateCallback callback) { > callback.update("foo").value("bar", 1).where("baz").eq(2)= .where("hello").isNull(); > } > }); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)