I have a hql query which works perfectly for everything except for one specific sutuation, which in my view doesn't differ from the others. And I don't know why this is happening.
I have a WHILE doing some retrieving inside it, the first pass goes ok, then the next one gives the error, I debuged and this happens right when I call session.createQuery, and I'm positive the query is correct as you can see on the log below. I've googled all over but no joy! please help!
Why would the second time createQuery is called, get an error? It's the exact same thing it did the first time in the loop, and the parameters passed are ok I'm sure. The first SELECT works fine, and the second one should do the same thing.
Code:
Hibernate: select candidatov0_.num_inscricao as num1_, candidatov0_.txt_nome as txt2_15_, candidatov0_.data_nasc as data3_15_, candidatov0_.num_cpf as num4_15_, candidatov0_.num_identidade as num5_15_, candidatov0_.txt_sexo as txt6_15_, candidatov0_.txt_email as txt7_15_, candidatov0_.txt_endereco as txt8_15_, candidatov0_.txt_bairro as txt9_15_, candidatov0_.txt_cidade as txt10_15_, candidatov0_.txt_uf as txt11_15_, candidatov0_.txt_cep as txt12_15_, candidatov0_.txt_telefone as txt13_15_, candidatov0_.txt_telefone2 as txt14_15_, candidatov0_.num_concurso as num15_15_, candidatov0_.num_cargo as num16_15_, candidatov0_.num_area as num17_15_, candidatov0_.num_subarea as num18_15_, candidatov0_.num_unidade as num19_15_, candidatov0_.num_deficiente as num20_15_, candidatov0_.num_classificacao as num21_15_, candidatov0_.num_chamado as num22_15_, candidatov0_.nota_objetiva as nota23_15_, candidatov0_.nota_pratica as nota24_15_, candidatov0_.nota_final as nota25_15_, candidatov0_.num_edHomologa as num26_15_ from smp.candidato candidatov0_ where candidatov0_.num_inscricao=4027787 and candidatov0_.num_cpf=45633754387
[*] 2006-07-12 16:44:15,937|ERROR|org.hibernate.hql.ast.ErrorCounter|*** ERROR: line 1:75: unexpected token: 93469645
org.hibernate.hql.ast.QuerySyntaxError: unexpected token: 93469645 near line 1, column 75 [from br.gov.embrapa.smp.vo.CandidatoVO where id = 4014650 and numCpf = 02793469645]
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:215)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)