score:2
Accepted answer
You could extend the Oracle dialect and add BITAND as a recoginzed HQL function:
public class OraclePlusDialect : Oracle10gDialect
{
public OraclePlusDialect()
{
RegisterFunction("bitand", new StandardSQLFunction("bitand", NHibernateUtil.Int32));
}
}
Then you should be able to execute your query like this:
var objects = _session.CreateQuery("select c from MyClass c
where bitand(c.someInteger, :param) > 0")
.SetParameter("param", otherInteger)
.List<MyClass>();
Possibly, Oracle has a type conversion problem becuase BITAND returns a rarely used data type. If this is the case, modify your HQL query to:
select c from MyClass c
where bitand(c.someInteger, :param) + 0 > 0
Source: stackoverflow.com
Related Articles
- Bitwise AND with NHibernate and Oracle
- Entity Framework Code First String Comparison with Oracle Db
- Why is Fluent NHibernate with LINQ returning an empty list (with Oracle database)?
- What does this C# code with an "arrow" mean and how is it called?
- NHibernate 3.0: No FirstOrDefault() with QueryOver?
- Getting count with NHibernate + Linq + Future
- NHibernate Second Level Cache With NHibernate Linq Provider 1.0
- How to implement Unit of Work that works with EF and NHibernate
- NHibernate Linq provider and take() skip() with eager fetching
- NHibernate linq query with IUserType
- Antlr exception with message "plan b" when walking IQueryable of NHibernate entities
- Using LINQ to SQL with Oracle
- Why doesn't this code compile in VS2010 with .NET 4.0?
- Compare only time from datetime in entity framework 6 with odp.net Oracle 12c
- Does not get exception when collection is empty with Sum method and Nhibernate
- NHibernate 3.1 Linq with Contains and Any
- Entity Framework with Oracle using odp.net not taking parameters in linq query
- Statistical query in SQL - is this possible with NHibernate LINQ?
- Using LINQ with NHibernate
- nhibernate queryover with complex join over non-related entities
- Why is this code with PredicateBuilder not working?
- How to generate dynamic expression with a bitwise operator and enums?
- Fetching records by date with only day part comparison using nhibernate
- Query a byte property with nhibernate cause invalid cast error
- Can you advise me a resource with LINQ/lambda code exercises?
- Extending LINQ to Nhibernate provider, in combination with Dynamic LINQ problem
- NHibernate 3 LINQ inner join issue with three jumps: NotSupportedException
- LINQ Source Code Available
- Linq with where clause in many-to-many EF Code First object
- C# Code Contracts -- How to ensure that a collection of items contains items with unique properties?
- Hot to get max value with where clause with EF5?
- SQL query to linq in mvc
- Two GroupBy's on LINQ query
- Dynamically generate LINQ select with nested collection properties
- LINQ to SQL error message: 'Where' not found
- Group objects of same kind C#
- CRM 2011 - Compare years in LINQ Query - Gives an error : Invalid 'where' condition. An entity member is invoking an invalid property or method
- Db4o query: find all objects with ID = {anything in array}
- Any way to make this LINQ faster?
- SQL Rank in LINQ to Entities
- LINQ, iterators, selecting and projection
- MongoDB: remove item from child collection
- Populate class from an XML using Linq
- DataGridView AllowUserToAddRow property doesn't work
- Could not translate expression
- Linq 'where' clause returning CS1929
- LINQ query to get the all the datarows based on a distinct column
- Linq query that reduces a subset of duplicates to a single value within a larger set?
- c# Linq query to group items by group and then sub-group
- Sorting Nested Collection with Linq