empire-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Döbele <doeb...@esteam.de>
Subject re: Bitwise support
Date Fri, 07 Aug 2015 08:37:56 GMT
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 = 5

Ivan
Mime
View raw message