Can anyone help. I'm using CXF v. 2.7.2 and have the following restful API
call which uses a FIQL expression to query for patients:
.../patients/search/firstname==James
In my handler method, I have the following code:
SearchCondition<Patient> sc = searchContext.getCondition(expression,
Patient.class);
JPATypedQueryVisitor<Patient> visitor = new
JPATypedQueryVisitor<Patient>(service.getEm(), Patient.class);
sc.accept(visitor);
TypedQuery<Patient> typedQuery = visitor.getQuery();
List<Patient> patients = typedQuery.getResultList();
where expression is the FIQL string, firstname==James.
When I run this, I get the following stack trace:
Exception: <openjpa-2.2.2-r422266:1468616 fatal general error>
org.apache.openjpa.persistence.PersistenceException: ERROR: unterminated
quoted string at or near "'\')"
Position: 841 {prepstmnt 1174610866 SELECT t0.patientid, t0.active,
t0.addedat, t0.address1, t0.firstname,... WHERE (t0.firstname LIKE ? ESCAPE
'\')} [code=0, state=42601]
at
org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.returnResponse(CxfRsInvoker.java:149)
at
org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.asyncInvoke(CxfRsInvoker.java:104)
at
org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.performInvocation(CxfRsInvoker.java:57)
at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:198)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:100)
call which uses a FIQL expression to query for patients:
.../patients/search/firstname==James
In my handler method, I have the following code:
SearchCondition<Patient> sc = searchContext.getCondition(expression,
Patient.class);
JPATypedQueryVisitor<Patient> visitor = new
JPATypedQueryVisitor<Patient>(service.getEm(), Patient.class);
sc.accept(visitor);
TypedQuery<Patient> typedQuery = visitor.getQuery();
List<Patient> patients = typedQuery.getResultList();
where expression is the FIQL string, firstname==James.
When I run this, I get the following stack trace:
Exception: <openjpa-2.2.2-r422266:1468616 fatal general error>
org.apache.openjpa.persistence.PersistenceException: ERROR: unterminated
quoted string at or near "'\')"
Position: 841 {prepstmnt 1174610866 SELECT t0.patientid, t0.active,
t0.addedat, t0.address1, t0.firstname,... WHERE (t0.firstname LIKE ? ESCAPE
'\')} [code=0, state=42601]
at
org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.returnResponse(CxfRsInvoker.java:149)
at
org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.asyncInvoke(CxfRsInvoker.java:104)
at
org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.performInvocation(CxfRsInvoker.java:57)
at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:198)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:100)