hello
How can I add Criteria to retrieve an entity with a WHERE clause which involves a function call?
Code:
select * from Person WHERE ... AND 1=fnCheckSomething(Person.Id, OwnerId)
btw, for our app, fnCheckSomething is only implemented for Oracle and M$SQL. For MySQL, because it can't do recursive function calls, it's in form of a stored proc which makes it even more difficult. At the momet, we've resorted to hand crafted stored proc because
"fnCheckSomething" is crucial and it interferes with paging/sort order as well.
Note that input to func includes:
a. Person.Id --- person is the entity we're trying to retrieve
b. OwnerId --- input param to "Stored Proc" (or FUNCTION) which contains this SELECT statement.
So, there're two sorts of param...
I suppose I need something which resembles: (1) Named query (with dynamic param, see above a and b) + (2) ICriteria which can add a *dynamic* Named-query somehow.
Thanks