Support bitwise operations

Description

Support bitwise operations like bitwise-and and bitwise-or via HQL or criteria expression.

from Domain.Employee employee where (employee.Status & 1) > 0

See related issue from Hibernate JIRA http://opensource.atlassian.com/projects/hibernate/browse/HHH-160

Thank you in advance.

Environment

None

Activity

Show:

Alex Zaytsev 
October 2, 2013 at 8:48 AM

Consider reopen of this issue.

Alexey Gorbach 
April 18, 2011 at 7:34 AM

It is not fixed for oracle. It uses & in bitwise and operations, while it should call function bitand.

Tuna Toksoz 
June 21, 2009 at 1:19 AM

Tests added to support this is not an issue in rev 4498.
Probably fixed with the new parser.

Tuna Toksoz 
November 14, 2008 at 8:25 AM

Stefan, you can probably use specific function which you can register in the dialect. It won't be like

(x & 1)

but be like

band(x,1)

probably works.

Stefan Steinegger 
November 14, 2008 at 6:30 AM

I added this into my configuration:
<property name="query.substitutions">bw_or=^, bw_and=&amp;, bw_not=~</property>
It works, but it's not nice. I have many configuration files for tests and development and production. This is hard to maintain. Would be really nice if NHibernate would support it.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created November 7, 2007 at 3:17 PM
Updated July 24, 2014 at 8:36 PM
Resolved June 21, 2009 at 4:38 AM
Who's Looking?