Olá pessoal,
estou tentando executar essa query no meu DAO:
Query q = session.createQuery("from br.inf.portalfiscal.nfe.model.protNFe.RetornoProcessamentoVO r where r.numRecibo :recibo");
q.setParameter("recibo", recibo);
RetornoProcessamentoVO vo = (RetornoProcessamentoVO) q.uniqueResult();
Mas quando ele tenta executar a primeira linha:
Query q = session.createQuery("from br.inf.portalfiscal.nfe.model.protNFe.RetornoProcessamentoVO r where r.numRecibo :recibo");
ele dá o seguinte erro:
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: : near line 1, column 87 [from br.inf.portalfiscal.nfe.model.protNFe.RetornoProcessamentoVO r where r.numRecibo :recibo]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
...
Eis o meu HBM do Vo:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping
>
<class
name="br.inf.portalfiscal.nfe.model.protNFe.RetornoProcessamentoVO"
table="RETORNO_PROCESSAMENTO"
>
<id
name="identificador"
column="IDENTIFICADOR"
type="long"
unsaved-value="null"
>
<generator class="native">
<param name="sequence">SQ_RETORNO_PROC</param>
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-RetornoProcessamentoVO.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>
<property
name="numRecibo"
type="long"
update="true"
insert="true"
column="RECIBO"
not-null="false"
unique="true"
/>
<property
name="xmlCabecalho"
type="br.inf.portalfiscal.util.StringClobType"
update="true"
insert="true"
column="XML_CABECALHO"
not-null="false"
unique="false"
/>
<property
name="xmlDados"
type="br.inf.portalfiscal.util.StringClobType"
update="true"
insert="true"
column="XML_DADOS"
not-null="false"
unique="false"
/>
<property
name="xmlRetornoProc"
type="br.inf.portalfiscal.util.StringClobType"
update="true"
insert="true"
column="XML_PROCESSAMENTO"
not-null="false"
unique="false"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-RetornoProcessamentoVO.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>