How to make a "null table" in NHibernate?

In other words, how do you do something simple:

select 1

      

Or more specifically in the specific problem I'm dealing with, something like this:

SELECT (case when exists (<subquery>) then 1 else 0 end) AS result

      

In short, is there a way in NHibernate to make a selection without creating a "FROM table" clause?

0


a source to share


2 answers


You are wrong about this problem.



Execute the subquery you use after calculating the counter, then execute the if else logic in your code.

+1


a source


I would turn this <subquery>

into a style request select top 1 id from table

. Then check for non-empty result. Any NH request is always triggered from table

.



0


a source







All Articles