Any help me with this error:

Source:

public IList BuscarPendenciasEmpresaMatriz(int idEmpresa)
        {
            ISession sessao =
GerenciadorSessoesNHibernate.Instancia.SessaoAtual;
            DateTime dataLimite = DateTime.Now;

            StringBuilder queryConfig = new StringBuilder(
                "FROM ConfiguracaoDMPLight c WHERE c.Empresa.Id = ");
            queryConfig.Append(idEmpresa);
            queryConfig.Append(" AND (c.Empresa.UltimoCalculo IS
NULL");
            queryConfig.Append(" OR c.UltimaAlteracao BETWEEN
c.Empresa.UltimoCalculo AND :data)");

            StringBuilder queryRegra = new StringBuilder(
                "FROM RegraCalculo rc WHERE rc.Empresa.Id = ");
            queryRegra.Append(idEmpresa);
            queryRegra.Append(" AND (rc.Empresa.UltimoCalculo IS
NULL");
            queryRegra.Append(" OR rc.UltimaAlteracao BETWEEN
rc.Empresa.UltimoCalculo AND :data)");

            StringBuilder queryHorario = new StringBuilder(
                "FROM Horario h WHERE h.Empresa.Id = ");
            queryHorario.Append(idEmpresa);
            queryHorario.Append(" AND (h.Empresa.UltimoCalculo IS
NULL");
            queryHorario.Append(" OR h.UltimaAlteracao BETWEEN
h.Empresa.UltimoCalculo AND :data)");

            StringBuilder queryFeriado = new StringBuilder(
                "FROM Feriado f, ELEMENTS(f.Empresas) e WHERE (e.Id =
");
            queryFeriado.Append(idEmpresa);
            queryFeriado.Append(" AND (e.UltimoCalculo IS NULL");
            queryFeriado.Append(" OR f.UltimaAlteracao BETWEEN
e.UltimoCalculo AND :data)");
            queryFeriado.Append(")");

            StringBuilder queryFeriadoRemovido = new StringBuilder(
                "FROM FeriadoRemovido f WHERE f.IdEmpresa = ");
            queryFeriadoRemovido.Append(idEmpresa);
            queryFeriadoRemovido.Append(" AND f.IdEmpresa IN (SELECT
e.Id FROM Empresa e");
            queryFeriadoRemovido.Append(" WHERE e.UltimoCalculo IS
NULL");
            queryFeriadoRemovido.Append(" OR f.UltimaAlteracao BETWEEN
e.UltimoCalculo AND :data)");


         //****HERE throws exception*****
                IList ids = sessao
                .CreateMultiQuery()
                .Add(sessao.CreateQuery(queryConfig.ToString()))
                    .SetDateTime("data", dataLimite)
                .Add(sessao.CreateQuery(queryRegra.ToString()))
                    .SetDateTime("data", dataLimite)
                .Add(sessao.CreateQuery(queryHorario.ToString()))
                    .SetDateTime("data", dataLimite)
                .Add(sessao.CreateQuery(queryFeriado.ToString()))
                    .SetDateTime("data", dataLimite)
                .Add(sessao.CreateQuery(queryFeriadoRemovido.ToString()))
                    .SetDateTime("data", dataLimite)
                .List();

            return ids;
        }

Error

Exception of type 'Antlr.Runtime.MismatchedTokenException' was thrown.
near line 1, column 65

   at NHibernate.Hql.Ast.ANTLR.ErrorCounter.ThrowQueryException() in c:
\Users\oskar.berggren\Documents\Projects\nhibernate-core-3\src
\NHibernate\Hql\Ast\ANTLR\ErrorCounter.cs:line 69
   at NHibernate.Hql.Ast.ANTLR.HqlParseEngine.Parse() in c:\Users
\oskar.berggren\Documents\Projects\nhibernate-core-3\src\NHibernate\Hql
\Ast\ANTLR\QueryTranslatorImpl.cs:line 479
   at
NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory.CreateQueryTranslators(String
queryString, String collectionRole, Boolean shallow, IDictionary`2
filters, ISessionFactoryImplementor factory) in c:\Users\oskar.berggren
\Documents\Projects\nhibernate-core-3\src\NHibernate\Hql\Ast\ANTLR
\ASTQueryTranslatorFactory.cs:line 19
   at
NHibernate.Engine.Query.HQLStringQueryPlan.CreateTranslators(String
hql, String collectionRole, Boolean shallow, IDictionary`2
enabledFilters, ISessionFactoryImplementor factory) in c:\Users
\oskar.berggren\Documents\Projects\nhibernate-core-3\src\NHibernate
\Engine\Query\HQLStringQueryPlan.cs:line 24
   at NHibernate.Engine.Query.HQLStringQueryPlan..ctor(String hql,
String collectionRole, Boolean shallow, IDictionary`2 enabledFilters,
ISessionFactoryImplementor factory) in c:\Users\oskar.berggren
\Documents\Projects\nhibernate-core-3\src\NHibernate\Engine\Query
\HQLStringQueryPlan.cs:line 16
   at NHibernate.Engine.Query.HQLStringQueryPlan..ctor(String hql,
Boolean shallow, IDictionary`2 enabledFilters,
ISessionFactoryImplementor factory) in c:\Users\oskar.berggren
\Documents\Projects\nhibernate-core-3\src\NHibernate\Engine\Query
\HQLStringQueryPlan.cs:line 10
   at NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(String
queryString, Boolean shallow, IDictionary`2 enabledFilters) in c:\Users
\oskar.berggren\Documents\Projects\nhibernate-core-3\src\NHibernate
\Engine\Query\QueryPlanCache.cs:line 61
   at NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan(String
query, Boolean shallow) in c:\Users\oskar.berggren\Documents\Projects
\nhibernate-core-3\src\NHibernate\Impl\AbstractSessionImpl.cs:line 304
   at NHibernate.Impl.AbstractSessionImpl.CreateQuery(String
queryString) in c:\Users\oskar.berggren\Documents\Projects\nhibernate-
core-3\src\NHibernate\Impl\AbstractSessionImpl.cs:line 283
   at
org.cesar.dmplight.servicoDmpLight.calculo.impl.RepositorioCalculo.BuscarPendenciasEmpresaMatriz(Int32
idEmpresa) in D:\Projetos CESAR\DIMEP-LIGHT\src\OperacoesDMPLight\org
\cesar\dmplight\servicoDmpLight\calculo\impl
\RepositorioCalculo.cs:line 83
   at
org.cesar.dmplight.servicoDmpLight.calculo.impl.RepositorioCalculo.BuscarPendencias(Int32
idEmpresa) in D:\Projetos CESAR\DIMEP-LIGHT\src\OperacoesDMPLight\org
\cesar\dmplight\servicoDmpLight\calculo\impl
\RepositorioCalculo.cs:line 35
   at
org.cesar.dmplight.servicoDmpLight.impl.ControladorCalculo.calculo_DoWork(Object
sender, DoWorkEventArgs e) in D:\Projetos CESAR\DIMEP-LIGHT\src
\OperacoesDMPLight\org\cesar\dmplight\servicoDmpLight\impl
\ControladorCalculo.cs:line 770

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to