Hi,
I'm with a problem with IQuery and second level cache when I execute the following code:
string sql = @"select itemProposta
from ItemProposta itemProposta,
ItemEdital itemEdital,
LoteEdital loteEdital
where itemProposta.proposta.codigo = :codigoProposta
and itemEdital = itemProposta.itemEdital
and loteEdital = itemEdital.loteEdital
and loteEdital.codigo = :codigoLoteEdital";
IQuery query = this.Session.CreateQuery(sql);
query.SetCacheable(true);
query.SetInt32("codigoProposta", codigoProposta);
query.SetInt32("codigoLoteEdital", codigoLoteEdital);
query.SetResultTransformer(new NHibernate.Transform.DistinctRootEntityResultTransformer());
return query.List<IItemProposta>();
When the List method is executed it throws the following error: Unknown entity class: System.Object[], but if my IQuery object is not Cacheable or if I remove the ResultTransformer it works fine.
Can someone help me?
Thanks,
Murilo
|