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 3D74F1861E for ; Fri, 7 Aug 2015 09:30:00 +0000 (UTC) Received: (qmail 13823 invoked by uid 500); 7 Aug 2015 09:30:00 -0000 Delivered-To: apmail-empire-db-user-archive@empire-db.apache.org Received: (qmail 13792 invoked by uid 500); 7 Aug 2015 09:30:00 -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 13782 invoked by uid 99); 7 Aug 2015 09:30:00 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2015 09:30:00 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A154119DD13 for ; Fri, 7 Aug 2015 09:29:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.002 X-Spam-Level: *** X-Spam-Status: No, score=3.002 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=3, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id s4z9QVDcNu9B for ; Fri, 7 Aug 2015 09:29:40 +0000 (UTC) Received: from mail-yk0-f180.google.com (mail-yk0-f180.google.com [209.85.160.180]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id A4D4F20F17 for ; Fri, 7 Aug 2015 09:29:39 +0000 (UTC) Received: by ykdt205 with SMTP id t205so3794073ykd.1 for ; Fri, 07 Aug 2015 02:29:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=Gy4IUvDmftoeTDocZEpOz3KC7KOF2oezSmHG544G23U=; b=EARYXqRvZY4xJDSKL8VVhjJOi+D4H3VY/My2bGn76hnyfBkHhXO16wTYKvQKztb2Jw olTVsh7XRiHfrq69kQ2Incpv6YLIiNRCWgVbdvaeFwnkgnOYqSb/0bZtiSjMT9DMybOF Dte2ADaHt2wSfp+Jq7e23rqhq7VR/esv0VuSGyaUi+LbE23ooMlIjya6NTG5rcS539g/ nRkGwrTfa8K3gdbW+jkk1uxeMvQRosDNDxrJ3hFPTDKp0Z2WJIy6MzXGfQifPSc8Pfuc Smf2K+DRKqVQ/KVq2HHEAL62/F6ky3UAdNYyXN3f9CXBGlh+JRQ3EdF/mtxQWbtOFGSq tENw== X-Received: by 10.170.200.212 with SMTP id r203mr144978yke.10.1438939778696; Fri, 07 Aug 2015 02:29:38 -0700 (PDT) MIME-Version: 1.0 Sender: ivan.nemeth@gmail.com Received: by 10.37.194.1 with HTTP; Fri, 7 Aug 2015 02:29:19 -0700 (PDT) In-Reply-To: <723ECD29D465BC46ADF7646B1CC7261416539409@ESTEAMSBS11.esteam.local> References: <723ECD29D465BC46ADF7646B1CC7261416539409@ESTEAMSBS11.esteam.local> From: ivan nemeth Date: Fri, 7 Aug 2015 11:29:19 +0200 X-Google-Sender-Auth: u5rweLgVAhZv8IeoXk3m9A4BDBs Message-ID: Subject: Re: Bitwise support To: user Content-Type: multipart/alternative; boundary=001a113ba5685cce55051cb54669 --001a113ba5685cce55051cb54669 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Rainer, great, this is what I need. Thanks, Ivan On Fri, Aug 7, 2015 at 10:37 AM, Rainer D=C3=B6bele wro= te: > Hi Ivan, > > > > there is currently no bitwise operation built in, but you can easily > create it yourself. > > Just define this function somewhere in your code: > > > > private DBColumnExpr getBitwiseAndExpr(DBColumnExpr column, int bitmask) > > { > > return new DBFuncExpr(column, "? & {0}", new Object[] { new > Integer(bitmask) }, null, false, DataType.INTEGER); > > } > > > > Then you can easily create your constraint like this: > > > > cmd.where(getBitwiseAndExpr(MY_COLUMN, 5).is( 5 )); > > > > This will give you your desired statement. > > > > Regards, > > Rainer > > > > > > *from:* Ivan Nemeth [mailto:ivan.nemeth@gmail.com] > *to:* user > *re:* Bitwise support > > > > Hi, > > > > is there any bitwise operation support implemented in Empire? > > > > SELECT * FROM table WHERE state_col & 5 =3D 5 > > > > Ivan > --001a113ba5685cce55051cb54669 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Rainer,

great, this is what I need.<= /div>

Thanks,
Ivan

On Fri, Aug 7, 2015 at 10:37 AM, = Rainer D=C3=B6bele <doebele@esteam.de> wrote:

Hi Ivan,

=C2=A0

there is c= urrently no bitwise operation built in, but you can easily create it yourse= lf.

Just defin= e this function somewhere in your code:

=C2= =A0

private DBColumnExpr getBitwi= seAndExpr(DBColumnExpr column, int bitmask)

{

=C2=A0=C2=A0=C2=A0 return new= DBFuncExpr(column, "? & {0}", new Object[] { new Integer(bit= mask) }, null, false, DataType.INTEGER);

}

=C2= =A0

Then you c= an easily create your constraint like this:

=C2= =A0

cmd.where(getBitwiseAndExpr(M= Y_COLUMN, =C2=A05).is( 5 ));

=C2= =A0

This will = give you your desired statement.

=C2= =A0

Regards,

Rainer<= /u>

=C2= =A0

=C2= =A0

from: Ivan Nemeth [mailto:ivan.nemeth@gmail.com]
to: user
re: Bitwise support

=C2=A0

Hi,

=C2=A0

is there any bitwise operation support implemented i= n Empire?

=C2=A0

SELECT * =C2=A0FROM table WHERE state_col & 5 = =3D 5

=C2=A0

Ivan


--001a113ba5685cce55051cb54669--