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 Query
- Bitwise AND with NHibernate and Oracle
- What does this C# code with an "arrow" mean and how is it called?
- How to implement Unit of Work that works with EF and NHibernate
- NHibernate Linq provider and take() skip() with eager fetching
- Does not get exception when collection is empty with Sum method and Nhibernate
- NHibernate 3.1 Linq with Contains and Any
- How to generate dynamic expression with a bitwise operator and enums?
- C# - Linq optimize code with List and Where clause
- Stubbing Code for Test With Linq Expressions and Lambdas
- Entity Framework Code First String Comparison with Oracle Db
- NHibernate 3 throwing NotSupportedException with SQL Compact 4.0 and FirstOrDefault()
- SQL to nhibernate inner join with sub query and grouping
- How to group by and order by, with LINQ, NHibernate and uNHAddins
- Why is Fluent NHibernate with LINQ returning an empty list (with Oracle database)?
- Optimized code for Insert and Update in one method with LINQ?
- Find all subsets with Enumerable.Zip or bitwise AND logic
- How to bind and save an object containing a list of objects to database context in ASP.NET MVC with EF code first?
- Calling a shared code from Page method and WebApi Controller with Razor Pages
- Casts when using NHibernate and Oracle
- nhibernate query with child entities and lazy="false"
- Strange cast error with Linq and Oracle
- Unrecognised method call with NHibernate and Linq when only date part required
- Linq to xml with missing nodes in the source XML and null-coalescing operator won't work
- When to use .First and when to use .FirstOrDefault with LINQ?
- Join/Where with LINQ and Lambda
- How to perform .Max() on a property of all objects in a collection and return the object with maximum value
- LINQ with groupby and count
- Problem with LINQ to Entities and String.StartsWith
- Entity Framework, Code First and Full Text Search
- LINQ to SQL: GroupBy() and Max() to get the object with latest date
More Query from same tag
- ASP.Net LINQ data source error is ListView
- NHibernate, extend IQueryable with SQL method by extending DefaultLinqToHqlGeneratorsRegistry
- Get Display Enum in LINQ
- How to get same results from select as foreach when using GroupBy()
- LinqToEntities produces incorrect SQL (Doubled Subquery)
- c# linq to sql iterating through left join results
- select a specific graph of objects using linq
- Linq to Moq - Nullable Types
- Lookup entries by multiple keys
- Prevent Duplicates From Being Saved In Database
- Dynamic query in LINQ
- c# XML to linq error if null
- Refactor nested loops into a single LINQ Query
- Missing nodes cause a null exception crash linq to xml
- Select a string in a list of strings linq
- Mongo c# Driver Query (Select subfields)
- How to use linq extensions with Func parameters in Dynamic Linq expressions?
- Entity Framework "Joins" resulting in returning entire table from SQL
- C# LINQ to XML: number of elements, that have two same attributes?
- How does LINQ defer execution when in a using statement
- GetAll or GetList Functions And Performance Problem
- LINQ Outer Join Has Duplicates
- how do i pivot list of object and create new list in linq c#?
- Sort a list with where condition in linq c#
- Linq nested ID to match to list
- c# updating a value inside a List<int> thats inside a dictionary<string, List<int>> using Lambda
- Linq to XML VB.NET Select and edit rows and cells from a HTML table
- LINQ: Sequence contains no elements error
- Top three documents by group using LINQ
- How to display data in a matrix