Problem
I have a Linq query with NHibernate in which I need to concatenate the results with a separator to compare it with those of the% main_coq, is something similar to the one shown below:
IQueryable<string> queryList = (from t1 in Session.Query<Table1>()
where (from t2 in Session.Query<Table2>()
where t2.Table1 == t1
select t2.Table1.Id + "#").Contains(t1.Id + "#")
select t1.Nome);
// É possivel de alguma forma informar o NHibernate para não parametrizar o "#"? Já que no Firebird esse modo está me trazendo problemas.
IEnumerable<string> list = queryList.ToList();
That would result in a query similar to this in SQL:
select T1.ID, T1.NOME
from TABLE1 T1
where (T1.ID || @ P0) in (select (T2.TABLE1_ID || @P1)
from TABLE2 T2
where T2.TABLE1_ID = T1.ID)
This query executed in a Firebird database, generates the following error: Dynamic SQL Error .
This problem of concatenating parameters in Firebird select, I'm already trying to treat here .
Question
So I would like to know if there is any way to configure NHibernate so that in this query it does not parameterize the parameters and concatenate them in the query (In mode SQL Injection == ON, hehe), SQL getting similar to this:
select T1.ID, T1.NOME
from TABLE1 T1
where (T1.ID || '#') in (select (T2.TABLE1_ID || '#')
from TABLE2 T2
where T2.TABLE1_ID = T1.ID)
Is there any way to set this up in NHibernate?