Hi,
It seems like a bug :(
The syntax '[]' seems not to work in subselects.
NHibernate version:2.1.0
Example1:
Code:
from DTO_ProcessoHistorico dto
where exists
(
select distinct processo.IdBD
from DTO_ProcessoHistorico processo,
InstanciaDeProcesso instancia ,
ValorTextual as valor
where processo.IdDoProcesso = instancia.IdBD and
instancia.ValorDosAtributos.Valores['nomeDoAtributo'].Texto = 'valorDoAtributo'
) order by dto.CodigoDoProcesso asc
OR
Example2:
Code:
from DTO_ProcessoHistorico dto
where exists
(
select distinct processo.IdBD
from DTO_ProcessoHistorico processo,
InstanciaDeProcesso instancia ,
ValorTextual as valor
where processo.IdDoProcesso = instancia.IdBD and
instancia.ValorDosAtributos.Valores['nomeDoAtributo'] = valor and valor.Texto = 'valorDoAtributo'
) order by dto.CodigoDoProcesso asc
Both examples have the same behavior.
Exception:
NHibernate.QueryException: unexpected [ [from FPwWorkflow.Compartilhados.DTO.DTO_ProcessoHistorico dto
where exists
(
select distinct processo.IdBD
from FPwWorkflow.Compartilhados.DTO.DTO_ProcessoHistorico processo,
FPwWorkflow.Server.GerenciadorDeProcessos.InstanciaDeProcesso instancia ,
FPwWorkflow.Compartilhados.GerenciadorDeConceitos.Implementacoes.ValorTextual as valor
where processo.IdDoProcesso = instancia.IdBD and
instancia.ValorDosAtributos.Valores['nomeDoAtributo'].Texto = 'valorDoAtributo'
) order by dto.CodigoDoProcesso asc]
em NHibernate.Hql.Classic.WhereParser.Token(String token, QueryTranslator q)
em NHibernate.Hql.Classic.ClauseParser.Token(String token, QueryTranslator q)
em NHibernate.Hql.Classic.PreprocessingParser.Token(String token, QueryTranslator q)
em NHibernate.Hql.Classic.ParserHelper.Parse(IParser p, String text, String seperators, QueryTranslator q)
em NHibernate.Hql.Classic.QueryTranslator.Compile()
em NHibernate.Hql.Classic.QueryTranslator.Compile(IDictionary`2 replacements, Boolean scalar)
em NHibernate.Engine.Query.HQLQueryPlan..ctor(String hql, String collectionRole, Boolean shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor factory)
em NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(String queryString, Boolean shallow, IDictionary`2 enabledFilters)
em NHibernate.Impl.SessionImpl.GetQueries(String query, Boolean scalar) em Ayende.NHibernateQueryAnalyzer.Core.Model.Project.HqlToSql(String hqlQuery, IDictionary parameters)
em Ayende.NHibernateQueryAnalyzer.UserInterface.Presenters.QueryPresenter.TranslateHql()[/code]