Return-Path: X-Original-To: apmail-empire-db-user-archive@www.apache.org Delivered-To: apmail-empire-db-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A520811EE5 for ; Tue, 29 Jul 2014 15:11:36 +0000 (UTC) Received: (qmail 17884 invoked by uid 500); 29 Jul 2014 15:11:36 -0000 Delivered-To: apmail-empire-db-user-archive@empire-db.apache.org Received: (qmail 17837 invoked by uid 500); 29 Jul 2014 15:11:36 -0000 Mailing-List: contact user-help@empire-db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@empire-db.apache.org Delivered-To: mailing list user@empire-db.apache.org Received: (qmail 17825 invoked by uid 99); 29 Jul 2014 15:11:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jul 2014 15:11:36 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FROM_12LTRDOM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ivan.nemeth@gmail.com designates 209.85.213.53 as permitted sender) Received: from [209.85.213.53] (HELO mail-yh0-f53.google.com) (209.85.213.53) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jul 2014 15:11:33 +0000 Received: by mail-yh0-f53.google.com with SMTP id c41so5771239yho.40 for ; Tue, 29 Jul 2014 08:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=nPh443S4Bh+91pUwLZzxmJcmyLRYouTPjNTRafdwoVQ=; b=OFzK3yp++uwXLFzBzBXPGn6EX15cwyM5bevIKmf+2wpD2wNp9egKOkBhQbe5yZh73O 2uOVPJY4G5Sz7LVFouKwB7yr0WQ61uovMi3amFg3T7RDQ1Zk+YqR+LjqZZxN7Ut7rXs0 xFCEUjTw4Yte9pI5wyX+Krq6JbMg6eqTa0V4iTzy7t0jOWsM1XTEStCw6yFXoDJStvDh MSjxCjDLvB+FMhcsw9RnKbo7Jd/r4++RhU7X1g9QOXAt7aihn0E66tHrVlQz47jPuUwl 5MQqAjgKjderdDD5dVuRMnRJLYetFNabtZmq41Xpj8HFzssX7ti11Ww0aI/l/46SN1qP uTCw== X-Received: by 10.236.57.232 with SMTP id o68mr3842294yhc.75.1406646668304; Tue, 29 Jul 2014 08:11:08 -0700 (PDT) MIME-Version: 1.0 Sender: ivan.nemeth@gmail.com Received: by 10.170.69.4 with HTTP; Tue, 29 Jul 2014 08:10:48 -0700 (PDT) From: ivan nemeth Date: Tue, 29 Jul 2014 17:10:48 +0200 X-Google-Sender-Auth: WA--7PZ18d9MgG1a7e7RcxLgWBg Message-ID: Subject: Constraints on the same column To: user@empire-db.apache.org Content-Type: multipart/alternative; boundary=bcaec50dc5defd2a7804ff5672bc X-Virus-Checked: Checked by ClamAV on apache.org --bcaec50dc5defd2a7804ff5672bc Content-Type: text/plain; charset=UTF-8 Hi, I tried to execute a query on a table which has a Date column. I want to add the following constraint TABLE.DATE >= ? AND TABLE.DATE <= ? If I write Date d0 = ... Date d1 = ... cmd.where(TABLE.DATE.isMoreOrEqual(d0)); cmd.where(TABLE.DATE.isLessOrEqual(d1)); then the first constraint is removed, and only the second is valid (I know this is a between constraint). The documentation of the DBCommand.where method says (However if I add the two constraint through the DBCommand.addWhereConstraints method, it works.) Why is the previous constraint on the same column removed, what is the logic behind it? I think it's the developers responsibility not to make mutually exclusive conditions. Or am I missing something? Thanks, Ivan --bcaec50dc5defd2a7804ff5672bc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I tried to execute a query on a tab= le which has a Date column. I want to add the following constraint=C2=A0

TABLE.DATE >=3D ? AND TABLE.DATE <=3D ?
<= div>
If I write=C2=A0

Date d0 =3D ...
<= div>Date d1 =3D ...

cmd.where(TABLE.DATE.isMor= eOrEqual(d0));
cmd.where(TABLE.DATE.isLessOrEqual(d1));
=

then the first constraint is removed, and only the second is= valid (I know this is a between constraint).
The documentation o= f the DBCommand.where method says

<If another r= estriction already exists for the same column it will be replaced.>

(However if I add the two constraint through the = DBCommand.addWhereConstraints method, it works.)

W= hy is the previous constraint on the same column removed, what is the logic= behind it? I think it's the developers responsibility not to make mutu= ally exclusive conditions. Or am I missing something?

Thanks,
Ivan



--bcaec50dc5defd2a7804ff5672bc--