Hi
On 04/09/13 00:39, gsilverman wrote:
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]
I've found something related:
http://stackoverflow.com/questions/3499483/error-unterminated-quoted-string-at-or-near
and
http://stackoverflow.com/questions/11759002/executing-bash-script-error-unterminated-quoted-string-at-or-near
It is all related to PostGreSQL apparently and i wonder if it is to do
with OpenJPA adding some extra quotes during JPA to SQL conversion...
Can you post a sample Patient code (with JPA annotations) ? I'll do a
quick test with HSQLDB and hibernate and openjpa
Cheers
Sergey
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)
--
View this message in context:
http://cxf.547215.n5.nabble.com/FIQL-error-unterminated-quoted-string-at-or-near-tp5733495.html
Sent from the cxf-user mailing list archive at Nabble.com.