You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by gsilverman <gl...@pssd.com> on 2013/09/04 01:39:20 UTC

FIQL error unterminated quoted string at or near "'\')"

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)






--
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.

Re: FIQL error unterminated quoted string at or near "'\')"

Posted by gsilverman <gl...@pssd.com>.
I'm getting very discouraged with Apache Aries JPA. I've tried everything I
can think of to get a simple query like this to work:

Query query = em.createQuery("SELECT p FROM Patient p where p.lastname =
:lastname");
		query.setParameter("lastname", "Silver");		
		
List<Patient> patients = query.getResultList();

I've tried different property settings in my persistence.xml:

<property name="openjpa.jdbc.DBDictionary" value="postgres"/>  

and this:

<property name="openjpa.jdbc.DBDictionary"
value="postgres(SearchStringEscape=\)"/> 

and even this:

<property name="openjpa.jdbc.DBDictionary"
value="postgresRequiresSearchStringEscapeForLike=false)"/> 

Nothing works. I'm not even convinced Aries JPA even recognizes these
property settings.

In any case, I don't think this is a CXF issue at all.



--
View this message in context: http://cxf.547215.n5.nabble.com/FIQL-error-unterminated-quoted-string-at-or-near-tp5733495p5733548.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: FIQL error unterminated quoted string at or near "'\')"

Posted by Daniel Kulp <dk...@apache.org>.
On Sep 6, 2013, at 12:18 PM, gsilverman <gl...@pssd.com> wrote:

> Pardon my ignorance, but how can I get the 2.7.7-SNAPSHOT installed and
> active in Karaf? I tried something like this:
> 
> install mvn:org.apache.cxf/cxf-bundle-compatible/2.7.7-SNAPSHOT
> 
> but that erred with URL...could not be found.

Usually just a:

features:chooseurl  cxf 2.7.7-SNAPSHOT
features:install cxf


Would get it installed.  However, you may need to add the Apache snapshot repo to the list of repos that Karaf looks at by editing the org.ops4j.pax.url.mvn.cfg  file.   I think the default already has it, but your distribution may have edited it a bit.


-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: FIQL error unterminated quoted string at or near "'\')"

Posted by gsilverman <gl...@pssd.com>.
Well, I came up with a kludge that gets around the problem. I simply rewrite
the query that is created by the SearchCondition and run in a new Query.
Here is my 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();
		
		String q1 = typedQuery.toString().replace('*', 'p') + " ESCAPE '\'";
				
		Query query = service.getEm().createQuery(q1);
				
		List<Patient> patients = query.getResultList();

Now, when I call my Resful service like so:

/patients/search/lastname==Jones

I get the results without error.

I don't think this will work for all FIQL query strings, but it's a start.



--
View this message in context: http://cxf.547215.n5.nabble.com/FIQL-error-unterminated-quoted-string-at-or-near-tp5733495p5733648.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: FIQL error unterminated quoted string at or near "'\')"

Posted by gsilverman <gl...@pssd.com>.
Pardon my ignorance, but how can I get the 2.7.7-SNAPSHOT installed and
active in Karaf? I tried something like this:

install mvn:org.apache.cxf/cxf-bundle-compatible/2.7.7-SNAPSHOT

but that erred with URL...could not be found.











--
View this message in context: http://cxf.547215.n5.nabble.com/FIQL-error-unterminated-quoted-string-at-or-near-tp5733495p5733645.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: FIQL error unterminated quoted string at or near "'\')"

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 04/09/13 17:56, gsilverman wrote:
> Basic JPA querying works fine:
>
> Query query = em.createQuery("SELECT p FROM Patient p where
> p.lastname=:lastname");
> 		query.setParameter("lastname", "Silver");		
> 		
> List<Patient> patients = query.getResultList();
>
This bypasses a typed CriteriaBuilder API, so it is not 100% obvious 
OpenJPA is all clear

> I checked OPENJPA-2056. We have standard_conforming_strings property in
> Postgresql set to OFF.
>
> I also included this in my persistence.xml, as suggested in the article:
>
> <property name="openjpa.jdbc.DBDictionary"
> value="postgres(SearchStringEscape=\)"/>
>
> But it had no affect.
>
> You mentioned calling CriteriaBuilder.equal to bypass the LIKE issue, but if
> CriteriaBuilder is being used internally  by CXF, how could I bypass this
> and use it directly in my code?
>
See https://issues.apache.org/jira/browse/CXF-5253

I've updated JPA and a couple of other visitors to use a strict match by 
default unless a String value has a wildcard '*' or a wildcard (like) 
match is always preferred

I think it makes sense to do it consistently across all the relevant 
visitors, and as sucj it is not really related to this issue, but might 
help anyway, try CXCF 2.7.7-SNAPSHOT a bit later or CXF 2.7.7 (due shortly)

Sergey

>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/FIQL-error-unterminated-quoted-string-at-or-near-tp5733495p5733530.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


Re: FIQL error unterminated quoted string at or near "'\')"

Posted by gsilverman <gl...@pssd.com>.
Basic JPA querying works fine:

Query query = em.createQuery("SELECT p FROM Patient p where
p.lastname=:lastname");
		query.setParameter("lastname", "Silver");		
		
List<Patient> patients = query.getResultList();

I checked OPENJPA-2056. We have standard_conforming_strings property in
Postgresql set to OFF.

I also included this in my persistence.xml, as suggested in the article:

<property name="openjpa.jdbc.DBDictionary"
value="postgres(SearchStringEscape=\)"/>  

But it had no affect.

You mentioned calling CriteriaBuilder.equal to bypass the LIKE issue, but if
CriteriaBuilder is being used internally  by CXF, how could I bypass this
and use it directly in my code?



--
View this message in context: http://cxf.547215.n5.nabble.com/FIQL-error-unterminated-quoted-string-at-or-near-tp5733495p5733530.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: FIQL error unterminated quoted string at or near "'\')"

Posted by Sergey Beryozkin <sb...@gmail.com>.
One more thought, apparently Postgresql is sensistive to the use of
SQL LIKE operator.
JPA CriteriaBuilder has equal() and like() functions, at the moment CXF 
always calls CriteriaBuilder.like() if a given property is of type 
String, irrespectively if it has a wildcard value or not.

In this regard JPA visitor is doing it differently to other shipped 
visitors capable of supporting wildcards (SQL and Lucene) where only if 
a '*' is available then a wildcard match is enabled.

We need to call CriteriaBuilder.equal() for Strings unless the value has 
a wildcard - that will probably bypass Postgresql LIKE issue

Cheers, Sergey



On 04/09/13 17:04, Sergey Beryozkin wrote:
> This one looks related, apparently was fixed:
>
> https://issues.apache.org/jira/browse/OPENJPA-2056
>
> Please make pure JPA test code working first and then we will proceed
> from there
>
> Sergey
>
> On 04/09/13 16:58, Sergey Beryozkin wrote:
>> I've run a test with OpenJPA 2.2.0 and HSQLDB, and it works for me.
>> I just quickly modified one of the existing tests, typed:
>>
>> @Test
>>      public void testPatient() throws Exception {
>>          SearchCondition<Patient> filter =
>>              new FiqlParser<Patient>(Patient.class, null,
>> null).parse("firstname==Barry");
>>          SearchConditionVisitor<Patient, TypedQuery<Patient>> jpa =
>>              new JPATypedQueryVisitor<Patient>(em, Patient.class, null,
>> null);
>>          filter.accept(jpa);
>>          TypedQuery<Patient> query = jpa.getQuery();
>>          List<Patient> list = query.getResultList();
>>          Patient p = list.get(0);
>>          assertEquals("Barry", p.getFirstname());
>>      }
>>
>> where I added a single Patient Barry to the test DB, OpenJPA prints out
>> it can't dynamically enhance Patient:
>> 431  testUnitOpenJPA  INFO   [main] openjpa.Runtime - OpenJPA
>> dynamically loaded the class enhancer. Any classes that were not
>> enhanced at build time will be enhanced when they are loaded by the JVM.
>> 456  testUnitOpenJPA  INFO   [main] openjpa.Runtime - Starting OpenJPA
>> 2.2.0
>> 485  testUnitOpenJPA  INFO   [main] openjpa.jdbc.JDBC - Using dictionary
>> class "org.apache.openjpa.jdbc.sql.HSQLDictionary".
>> 1289  testUnitOpenJPA  WARN   [main] openjpa.MetaData - Meta class
>> "org.apache.cxf.jaxrs.ext.search.jpa.Patient_" for entity class
>> org.apache.cxf.jaxrs.ext.search.jpa.Patient can not be registered with
>> following exception "java.security.PrivilegedActionException:
>> java.lang.ClassNotFoundException:
>> org.apache.cxf.jaxrs.ext.search.jpa.Patient_"
>>
>> but otherwise test passes.
>>
>> I think the issue is in the OpenJpa Postgress adapter but it needs to be
>> confirmed first.
>>
>> I'd like to suggest you do the following:
>>
>> - ask at OpenJPA forums if they've heard of such Postgresql related
>> issues
>> - do a pure JPA code bypassing CXF which queries Postgresql and it it
>> works - share it with us - I will compare it with how CXF does it
>>
>> Cheers, Sergey
>>
>>
>>
>>
>>
>> On 04/09/13 15:57, gsilverman wrote:
>>> Thanks for replying. We are using Postgresql v 9 and I can't change
>>> that.
>>> Here is my patient entity class. It's nothing special:
>>>
>>> @Entity
>>> @Table(name="patients")
>>> public class Patient implements Serializable {
>>>     private static final long serialVersionUID = 1L;
>>>
>>>     @Id
>>>     private String patientid;
>>>
>>>     private Boolean active;
>>>
>>>     @Temporal(TemporalType.DATE)
>>>     private Date addedat;
>>>
>>>     private String address1;
>>>
>>>     private String address2;
>>>
>>>     private String altphoneneumber;
>>>
>>>     private String billtotype;
>>>
>>>     private String chartnumber;
>>>
>>>     private String city;
>>>
>>>     private String country;
>>>
>>>     @Temporal(TemporalType.DATE)
>>>     private Date dateofbirth;
>>>
>>>     private String driverslicense;
>>>
>>>     private String emailaddress;
>>>
>>>     private String firstname;
>>>
>>>     private String gender;
>>>
>>>     private String language;
>>>
>>>     private String lasteligibilityresult;
>>>
>>>     private String lasteligibilityresultobm;
>>>
>>>     private Timestamp lasteligibilitytimestamp;
>>>
>>>     private Timestamp lasteligibilitytimestampobm;
>>>
>>>     private Timestamp lasteligibilityverification;
>>>
>>>     private Timestamp lasteligibilityverificationobm;
>>>
>>>     private String lastname;
>>>
>>>     private String maritalstatus;
>>>
>>>     private String middleinitial;
>>>
>>>     private Timestamp modifiedat;
>>>
>>>     private String nameofspouse;
>>>
>>>     private String patientnumber;
>>>
>>>     private String phonenumber;
>>>
>>>     private String ssn;
>>>
>>>     private String state;
>>>
>>>     private String zip;
>>>
>>>     //bi-directional many-to-one association to Patientemployer
>>>     @ManyToOne
>>>     @JoinColumn(name="patientemployerid")
>>>     private Patientemployer patientemployer;
>>>
>>>     @OneToMany(mappedBy = "patient", fetch = FetchType.LAZY)
>>>     private List<Workerscompclaim> workerscompclaims;
>>>
>>>     public Patient() {
>>>     }
>>>
>>>     public String getPatientid() {
>>>         return this.patientid;
>>>     }
>>>
>>>     public void setPatientid(String patientid) {
>>>         this.patientid = patientid;
>>>     }
>>>
>>>     public Boolean getActive() {
>>>         return this.active;
>>>     }
>>>
>>>     public void setActive(Boolean active) {
>>>         this.active = active;
>>>     }
>>>
>>>     public Date getAddedat() {
>>>         return this.addedat;
>>>     }
>>>
>>>     public void setAddedat(Date addedat) {
>>>         this.addedat = addedat;
>>>     }
>>>
>>>     public String getAddress1() {
>>>         return this.address1;
>>>     }
>>>
>>>     public void setAddress1(String address1) {
>>>         this.address1 = address1;
>>>     }
>>>
>>>     public String getAddress2() {
>>>         return this.address2;
>>>     }
>>>
>>>     public void setAddress2(String address2) {
>>>         this.address2 = address2;
>>>     }
>>>
>>>     public String getAltphoneneumber() {
>>>         return this.altphoneneumber;
>>>     }
>>>
>>>     public void setAltphoneneumber(String altphoneneumber) {
>>>         this.altphoneneumber = altphoneneumber;
>>>     }
>>>
>>>     public String getBilltotype() {
>>>         return this.billtotype;
>>>     }
>>>
>>>     public void setBilltotype(String billtotype) {
>>>         this.billtotype = billtotype;
>>>     }
>>>
>>>     public String getChartnumber() {
>>>         return this.chartnumber;
>>>     }
>>>
>>>     public void setChartnumber(String chartnumber) {
>>>         this.chartnumber = chartnumber;
>>>     }
>>>
>>>     public String getCity() {
>>>         return this.city;
>>>     }
>>>
>>>     public void setCity(String city) {
>>>         this.city = city;
>>>     }
>>>
>>>     public String getCountry() {
>>>         return this.country;
>>>     }
>>>
>>>     public void setCountry(String country) {
>>>         this.country = country;
>>>     }
>>>
>>>     public Date getDateofbirth() {
>>>         return this.dateofbirth;
>>>     }
>>>
>>>     public void setDateofbirth(Date dateofbirth) {
>>>         this.dateofbirth = dateofbirth;
>>>     }
>>>
>>>     public String getDriverslicense() {
>>>         return this.driverslicense;
>>>     }
>>>
>>>     public void setDriverslicense(String driverslicense) {
>>>         this.driverslicense = driverslicense;
>>>     }
>>>
>>>     public String getEmailaddress() {
>>>         return this.emailaddress;
>>>     }
>>>
>>>     public void setEmailaddress(String emailaddress) {
>>>         this.emailaddress = emailaddress;
>>>     }
>>>
>>>     public String getFirstname() {
>>>         return this.firstname;
>>>     }
>>>
>>>     public void setFirstname(String firstname) {
>>>         this.firstname = firstname;
>>>     }
>>>
>>>     public String getGender() {
>>>         return this.gender;
>>>     }
>>>
>>>     public void setGender(String gender) {
>>>         this.gender = gender;
>>>     }
>>>
>>>     public String getLanguage() {
>>>         return this.language;
>>>     }
>>>
>>>     public void setLanguage(String language) {
>>>         this.language = language;
>>>     }
>>>
>>>     public String getLasteligibilityresult() {
>>>         return this.lasteligibilityresult;
>>>     }
>>>
>>>     public void setLasteligibilityresult(String lasteligibilityresult) {
>>>         this.lasteligibilityresult = lasteligibilityresult;
>>>     }
>>>
>>>     public String getLasteligibilityresultobm() {
>>>         return this.lasteligibilityresultobm;
>>>     }
>>>
>>>     public void setLasteligibilityresultobm(String
>>> lasteligibilityresultobm) {
>>>         this.lasteligibilityresultobm = lasteligibilityresultobm;
>>>     }
>>>
>>>     public Timestamp getLasteligibilitytimestamp() {
>>>         return this.lasteligibilitytimestamp;
>>>     }
>>>
>>>     public void setLasteligibilitytimestamp(Timestamp
>>> lasteligibilitytimestamp)
>>> {
>>>         this.lasteligibilitytimestamp = lasteligibilitytimestamp;
>>>     }
>>>
>>>     public Timestamp getLasteligibilitytimestampobm() {
>>>         return this.lasteligibilitytimestampobm;
>>>     }
>>>
>>>     public void setLasteligibilitytimestampobm(Timestamp
>>> lasteligibilitytimestampobm) {
>>>         this.lasteligibilitytimestampobm = lasteligibilitytimestampobm;
>>>     }
>>>
>>>     public Timestamp getLasteligibilityverification() {
>>>         return this.lasteligibilityverification;
>>>     }
>>>
>>>     public void setLasteligibilityverification(Timestamp
>>> lasteligibilityverification) {
>>>         this.lasteligibilityverification = lasteligibilityverification;
>>>     }
>>>
>>>     public Timestamp getLasteligibilityverificationobm() {
>>>         return this.lasteligibilityverificationobm;
>>>     }
>>>
>>>     public void setLasteligibilityverificationobm(Timestamp
>>> lasteligibilityverificationobm) {
>>>         this.lasteligibilityverificationobm =
>>> lasteligibilityverificationobm;
>>>     }
>>>
>>>     public String getLastname() {
>>>         return this.lastname;
>>>     }
>>>
>>>     public void setLastname(String lastname) {
>>>         this.lastname = lastname;
>>>     }
>>>
>>>     public String getMaritalstatus() {
>>>         return this.maritalstatus;
>>>     }
>>>
>>>     public void setMaritalstatus(String maritalstatus) {
>>>         this.maritalstatus = maritalstatus;
>>>     }
>>>
>>>     public String getMiddleinitial() {
>>>         return this.middleinitial;
>>>     }
>>>
>>>     public void setMiddleinitial(String middleinitial) {
>>>         this.middleinitial = middleinitial;
>>>     }
>>>
>>>     public Timestamp getModifiedat() {
>>>         return this.modifiedat;
>>>     }
>>>
>>>     public void setModifiedat(Timestamp modifiedat) {
>>>         this.modifiedat = modifiedat;
>>>     }
>>>
>>>     public String getNameofspouse() {
>>>         return this.nameofspouse;
>>>     }
>>>
>>>     public void setNameofspouse(String nameofspouse) {
>>>         this.nameofspouse = nameofspouse;
>>>     }
>>>
>>>     public String getPatientnumber() {
>>>         return this.patientnumber;
>>>     }
>>>
>>>     public void setPatientnumber(String patientnumber) {
>>>         this.patientnumber = patientnumber;
>>>     }
>>>
>>>     public String getPhonenumber() {
>>>         return this.phonenumber;
>>>     }
>>>
>>>     public void setPhonenumber(String phonenumber) {
>>>         this.phonenumber = phonenumber;
>>>     }
>>>
>>>     public String getSsn() {
>>>         return this.ssn;
>>>     }
>>>
>>>     public void setSsn(String ssn) {
>>>         this.ssn = ssn;
>>>     }
>>>
>>>     public String getState() {
>>>         return this.state;
>>>     }
>>>
>>>     public void setState(String state) {
>>>         this.state = state;
>>>     }
>>>
>>>     public String getZip() {
>>>         return this.zip;
>>>     }
>>>
>>>     public void setZip(String zip) {
>>>         this.zip = zip;
>>>     }
>>>
>>>     public Patientemployer getPatientemployer() {
>>>         return this.patientemployer;
>>>     }
>>>
>>>     public void setPatientemployer(Patientemployer patientemployer) {
>>>         this.patientemployer = patientemployer;
>>>     }
>>>
>>>     public List<Workerscompclaim> getWorkerscompclaims() {
>>>         return workerscompclaims;
>>>     }
>>>
>>>     public void setWorkerscompclaims(List<Workerscompclaim>
>>> workerscompclaims)
>>> {
>>>         this.workerscompclaims = workerscompclaims;
>>>     }
>>>
>>> }
>>>
>>> Can you tell me if there is a possible workaround should this prove to
>>> be a
>>> postgresql issue?
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://cxf.547215.n5.nabble.com/FIQL-error-unterminated-quoted-string-at-or-near-tp5733495p5733520.html
>>>
>>>
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>
>>
>
>



Re: FIQL error unterminated quoted string at or near "'\')"

Posted by Sergey Beryozkin <sb...@gmail.com>.
This one looks related, apparently was fixed:

https://issues.apache.org/jira/browse/OPENJPA-2056

Please make pure JPA test code working first and then we will proceed 
from there

Sergey

On 04/09/13 16:58, Sergey Beryozkin wrote:
> I've run a test with OpenJPA 2.2.0 and HSQLDB, and it works for me.
> I just quickly modified one of the existing tests, typed:
>
> @Test
>      public void testPatient() throws Exception {
>          SearchCondition<Patient> filter =
>              new FiqlParser<Patient>(Patient.class, null,
> null).parse("firstname==Barry");
>          SearchConditionVisitor<Patient, TypedQuery<Patient>> jpa =
>              new JPATypedQueryVisitor<Patient>(em, Patient.class, null,
> null);
>          filter.accept(jpa);
>          TypedQuery<Patient> query = jpa.getQuery();
>          List<Patient> list = query.getResultList();
>          Patient p = list.get(0);
>          assertEquals("Barry", p.getFirstname());
>      }
>
> where I added a single Patient Barry to the test DB, OpenJPA prints out
> it can't dynamically enhance Patient:
> 431  testUnitOpenJPA  INFO   [main] openjpa.Runtime - OpenJPA
> dynamically loaded the class enhancer. Any classes that were not
> enhanced at build time will be enhanced when they are loaded by the JVM.
> 456  testUnitOpenJPA  INFO   [main] openjpa.Runtime - Starting OpenJPA
> 2.2.0
> 485  testUnitOpenJPA  INFO   [main] openjpa.jdbc.JDBC - Using dictionary
> class "org.apache.openjpa.jdbc.sql.HSQLDictionary".
> 1289  testUnitOpenJPA  WARN   [main] openjpa.MetaData - Meta class
> "org.apache.cxf.jaxrs.ext.search.jpa.Patient_" for entity class
> org.apache.cxf.jaxrs.ext.search.jpa.Patient can not be registered with
> following exception "java.security.PrivilegedActionException:
> java.lang.ClassNotFoundException:
> org.apache.cxf.jaxrs.ext.search.jpa.Patient_"
>
> but otherwise test passes.
>
> I think the issue is in the OpenJpa Postgress adapter but it needs to be
> confirmed first.
>
> I'd like to suggest you do the following:
>
> - ask at OpenJPA forums if they've heard of such Postgresql related issues
> - do a pure JPA code bypassing CXF which queries Postgresql and it it
> works - share it with us - I will compare it with how CXF does it
>
> Cheers, Sergey
>
>
>
>
>
> On 04/09/13 15:57, gsilverman wrote:
>> Thanks for replying. We are using Postgresql v 9 and I can't change that.
>> Here is my patient entity class. It's nothing special:
>>
>> @Entity
>> @Table(name="patients")
>> public class Patient implements Serializable {
>>     private static final long serialVersionUID = 1L;
>>
>>     @Id
>>     private String patientid;
>>
>>     private Boolean active;
>>
>>     @Temporal(TemporalType.DATE)
>>     private Date addedat;
>>
>>     private String address1;
>>
>>     private String address2;
>>
>>     private String altphoneneumber;
>>
>>     private String billtotype;
>>
>>     private String chartnumber;
>>
>>     private String city;
>>
>>     private String country;
>>
>>     @Temporal(TemporalType.DATE)
>>     private Date dateofbirth;
>>
>>     private String driverslicense;
>>
>>     private String emailaddress;
>>
>>     private String firstname;
>>
>>     private String gender;
>>
>>     private String language;
>>
>>     private String lasteligibilityresult;
>>
>>     private String lasteligibilityresultobm;
>>
>>     private Timestamp lasteligibilitytimestamp;
>>
>>     private Timestamp lasteligibilitytimestampobm;
>>
>>     private Timestamp lasteligibilityverification;
>>
>>     private Timestamp lasteligibilityverificationobm;
>>
>>     private String lastname;
>>
>>     private String maritalstatus;
>>
>>     private String middleinitial;
>>
>>     private Timestamp modifiedat;
>>
>>     private String nameofspouse;
>>
>>     private String patientnumber;
>>
>>     private String phonenumber;
>>
>>     private String ssn;
>>
>>     private String state;
>>
>>     private String zip;
>>
>>     //bi-directional many-to-one association to Patientemployer
>>     @ManyToOne
>>     @JoinColumn(name="patientemployerid")
>>     private Patientemployer patientemployer;
>>
>>     @OneToMany(mappedBy = "patient", fetch = FetchType.LAZY)
>>     private List<Workerscompclaim> workerscompclaims;
>>
>>     public Patient() {
>>     }
>>
>>     public String getPatientid() {
>>         return this.patientid;
>>     }
>>
>>     public void setPatientid(String patientid) {
>>         this.patientid = patientid;
>>     }
>>
>>     public Boolean getActive() {
>>         return this.active;
>>     }
>>
>>     public void setActive(Boolean active) {
>>         this.active = active;
>>     }
>>
>>     public Date getAddedat() {
>>         return this.addedat;
>>     }
>>
>>     public void setAddedat(Date addedat) {
>>         this.addedat = addedat;
>>     }
>>
>>     public String getAddress1() {
>>         return this.address1;
>>     }
>>
>>     public void setAddress1(String address1) {
>>         this.address1 = address1;
>>     }
>>
>>     public String getAddress2() {
>>         return this.address2;
>>     }
>>
>>     public void setAddress2(String address2) {
>>         this.address2 = address2;
>>     }
>>
>>     public String getAltphoneneumber() {
>>         return this.altphoneneumber;
>>     }
>>
>>     public void setAltphoneneumber(String altphoneneumber) {
>>         this.altphoneneumber = altphoneneumber;
>>     }
>>
>>     public String getBilltotype() {
>>         return this.billtotype;
>>     }
>>
>>     public void setBilltotype(String billtotype) {
>>         this.billtotype = billtotype;
>>     }
>>
>>     public String getChartnumber() {
>>         return this.chartnumber;
>>     }
>>
>>     public void setChartnumber(String chartnumber) {
>>         this.chartnumber = chartnumber;
>>     }
>>
>>     public String getCity() {
>>         return this.city;
>>     }
>>
>>     public void setCity(String city) {
>>         this.city = city;
>>     }
>>
>>     public String getCountry() {
>>         return this.country;
>>     }
>>
>>     public void setCountry(String country) {
>>         this.country = country;
>>     }
>>
>>     public Date getDateofbirth() {
>>         return this.dateofbirth;
>>     }
>>
>>     public void setDateofbirth(Date dateofbirth) {
>>         this.dateofbirth = dateofbirth;
>>     }
>>
>>     public String getDriverslicense() {
>>         return this.driverslicense;
>>     }
>>
>>     public void setDriverslicense(String driverslicense) {
>>         this.driverslicense = driverslicense;
>>     }
>>
>>     public String getEmailaddress() {
>>         return this.emailaddress;
>>     }
>>
>>     public void setEmailaddress(String emailaddress) {
>>         this.emailaddress = emailaddress;
>>     }
>>
>>     public String getFirstname() {
>>         return this.firstname;
>>     }
>>
>>     public void setFirstname(String firstname) {
>>         this.firstname = firstname;
>>     }
>>
>>     public String getGender() {
>>         return this.gender;
>>     }
>>
>>     public void setGender(String gender) {
>>         this.gender = gender;
>>     }
>>
>>     public String getLanguage() {
>>         return this.language;
>>     }
>>
>>     public void setLanguage(String language) {
>>         this.language = language;
>>     }
>>
>>     public String getLasteligibilityresult() {
>>         return this.lasteligibilityresult;
>>     }
>>
>>     public void setLasteligibilityresult(String lasteligibilityresult) {
>>         this.lasteligibilityresult = lasteligibilityresult;
>>     }
>>
>>     public String getLasteligibilityresultobm() {
>>         return this.lasteligibilityresultobm;
>>     }
>>
>>     public void setLasteligibilityresultobm(String
>> lasteligibilityresultobm) {
>>         this.lasteligibilityresultobm = lasteligibilityresultobm;
>>     }
>>
>>     public Timestamp getLasteligibilitytimestamp() {
>>         return this.lasteligibilitytimestamp;
>>     }
>>
>>     public void setLasteligibilitytimestamp(Timestamp
>> lasteligibilitytimestamp)
>> {
>>         this.lasteligibilitytimestamp = lasteligibilitytimestamp;
>>     }
>>
>>     public Timestamp getLasteligibilitytimestampobm() {
>>         return this.lasteligibilitytimestampobm;
>>     }
>>
>>     public void setLasteligibilitytimestampobm(Timestamp
>> lasteligibilitytimestampobm) {
>>         this.lasteligibilitytimestampobm = lasteligibilitytimestampobm;
>>     }
>>
>>     public Timestamp getLasteligibilityverification() {
>>         return this.lasteligibilityverification;
>>     }
>>
>>     public void setLasteligibilityverification(Timestamp
>> lasteligibilityverification) {
>>         this.lasteligibilityverification = lasteligibilityverification;
>>     }
>>
>>     public Timestamp getLasteligibilityverificationobm() {
>>         return this.lasteligibilityverificationobm;
>>     }
>>
>>     public void setLasteligibilityverificationobm(Timestamp
>> lasteligibilityverificationobm) {
>>         this.lasteligibilityverificationobm =
>> lasteligibilityverificationobm;
>>     }
>>
>>     public String getLastname() {
>>         return this.lastname;
>>     }
>>
>>     public void setLastname(String lastname) {
>>         this.lastname = lastname;
>>     }
>>
>>     public String getMaritalstatus() {
>>         return this.maritalstatus;
>>     }
>>
>>     public void setMaritalstatus(String maritalstatus) {
>>         this.maritalstatus = maritalstatus;
>>     }
>>
>>     public String getMiddleinitial() {
>>         return this.middleinitial;
>>     }
>>
>>     public void setMiddleinitial(String middleinitial) {
>>         this.middleinitial = middleinitial;
>>     }
>>
>>     public Timestamp getModifiedat() {
>>         return this.modifiedat;
>>     }
>>
>>     public void setModifiedat(Timestamp modifiedat) {
>>         this.modifiedat = modifiedat;
>>     }
>>
>>     public String getNameofspouse() {
>>         return this.nameofspouse;
>>     }
>>
>>     public void setNameofspouse(String nameofspouse) {
>>         this.nameofspouse = nameofspouse;
>>     }
>>
>>     public String getPatientnumber() {
>>         return this.patientnumber;
>>     }
>>
>>     public void setPatientnumber(String patientnumber) {
>>         this.patientnumber = patientnumber;
>>     }
>>
>>     public String getPhonenumber() {
>>         return this.phonenumber;
>>     }
>>
>>     public void setPhonenumber(String phonenumber) {
>>         this.phonenumber = phonenumber;
>>     }
>>
>>     public String getSsn() {
>>         return this.ssn;
>>     }
>>
>>     public void setSsn(String ssn) {
>>         this.ssn = ssn;
>>     }
>>
>>     public String getState() {
>>         return this.state;
>>     }
>>
>>     public void setState(String state) {
>>         this.state = state;
>>     }
>>
>>     public String getZip() {
>>         return this.zip;
>>     }
>>
>>     public void setZip(String zip) {
>>         this.zip = zip;
>>     }
>>
>>     public Patientemployer getPatientemployer() {
>>         return this.patientemployer;
>>     }
>>
>>     public void setPatientemployer(Patientemployer patientemployer) {
>>         this.patientemployer = patientemployer;
>>     }
>>
>>     public List<Workerscompclaim> getWorkerscompclaims() {
>>         return workerscompclaims;
>>     }
>>
>>     public void setWorkerscompclaims(List<Workerscompclaim>
>> workerscompclaims)
>> {
>>         this.workerscompclaims = workerscompclaims;
>>     }
>>
>> }
>>
>> Can you tell me if there is a possible workaround should this prove to
>> be a
>> postgresql issue?
>>
>>
>>
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/FIQL-error-unterminated-quoted-string-at-or-near-tp5733495p5733520.html
>>
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: FIQL error unterminated quoted string at or near "'\')"

Posted by Sergey Beryozkin <sb...@gmail.com>.
I've run a test with OpenJPA 2.2.0 and HSQLDB, and it works for me.
I just quickly modified one of the existing tests, typed:

@Test
     public void testPatient() throws Exception {
         SearchCondition<Patient> filter =
             new FiqlParser<Patient>(Patient.class, null, 
null).parse("firstname==Barry");
         SearchConditionVisitor<Patient, TypedQuery<Patient>> jpa =
             new JPATypedQueryVisitor<Patient>(em, Patient.class, null, 
null);
         filter.accept(jpa);
         TypedQuery<Patient> query = jpa.getQuery();
         List<Patient> list = query.getResultList();
         Patient p = list.get(0);
         assertEquals("Barry", p.getFirstname());
     }

where I added a single Patient Barry to the test DB, OpenJPA prints out 
it can't dynamically enhance Patient:
431  testUnitOpenJPA  INFO   [main] openjpa.Runtime - OpenJPA 
dynamically loaded the class enhancer. Any classes that were not 
enhanced at build time will be enhanced when they are loaded by the JVM.
456  testUnitOpenJPA  INFO   [main] openjpa.Runtime - Starting OpenJPA 2.2.0
485  testUnitOpenJPA  INFO   [main] openjpa.jdbc.JDBC - Using dictionary 
class "org.apache.openjpa.jdbc.sql.HSQLDictionary".
1289  testUnitOpenJPA  WARN   [main] openjpa.MetaData - Meta class 
"org.apache.cxf.jaxrs.ext.search.jpa.Patient_" for entity class 
org.apache.cxf.jaxrs.ext.search.jpa.Patient can not be registered with 
following exception "java.security.PrivilegedActionException: 
java.lang.ClassNotFoundException: 
org.apache.cxf.jaxrs.ext.search.jpa.Patient_"

but otherwise test passes.

I think the issue is in the OpenJpa Postgress adapter but it needs to 
be confirmed first.

I'd like to suggest you do the following:

- ask at OpenJPA forums if they've heard of such Postgresql related issues
- do a pure JPA code bypassing CXF which queries Postgresql and it it 
works - share it with us - I will compare it with how CXF does it

Cheers, Sergey





On 04/09/13 15:57, gsilverman wrote:
> Thanks for replying. We are using Postgresql v 9 and I can't change that.
> Here is my patient entity class. It's nothing special:
>
> @Entity
> @Table(name="patients")
> public class Patient implements Serializable {
> 	private static final long serialVersionUID = 1L;
>
> 	@Id
> 	private String patientid;
>
> 	private Boolean active;
>
> 	@Temporal(TemporalType.DATE)
> 	private Date addedat;
>
> 	private String address1;
>
> 	private String address2;
>
> 	private String altphoneneumber;
>
> 	private String billtotype;
>
> 	private String chartnumber;
>
> 	private String city;
>
> 	private String country;
>
> 	@Temporal(TemporalType.DATE)
> 	private Date dateofbirth;
>
> 	private String driverslicense;
>
> 	private String emailaddress;
>
> 	private String firstname;
>
> 	private String gender;
>
> 	private String language;
>
> 	private String lasteligibilityresult;
>
> 	private String lasteligibilityresultobm;
>
> 	private Timestamp lasteligibilitytimestamp;
>
> 	private Timestamp lasteligibilitytimestampobm;
>
> 	private Timestamp lasteligibilityverification;
>
> 	private Timestamp lasteligibilityverificationobm;
>
> 	private String lastname;
>
> 	private String maritalstatus;
>
> 	private String middleinitial;
>
> 	private Timestamp modifiedat;
>
> 	private String nameofspouse;
>
> 	private String patientnumber;
>
> 	private String phonenumber;
>
> 	private String ssn;
>
> 	private String state;
>
> 	private String zip;
>
> 	//bi-directional many-to-one association to Patientemployer
> 	@ManyToOne
> 	@JoinColumn(name="patientemployerid")
> 	private Patientemployer patientemployer;
> 	
> 	@OneToMany(mappedBy = "patient", fetch = FetchType.LAZY)
> 	private List<Workerscompclaim> workerscompclaims;
>
> 	public Patient() {
> 	}
>
> 	public String getPatientid() {
> 		return this.patientid;
> 	}
>
> 	public void setPatientid(String patientid) {
> 		this.patientid = patientid;
> 	}
>
> 	public Boolean getActive() {
> 		return this.active;
> 	}
>
> 	public void setActive(Boolean active) {
> 		this.active = active;
> 	}
>
> 	public Date getAddedat() {
> 		return this.addedat;
> 	}
>
> 	public void setAddedat(Date addedat) {
> 		this.addedat = addedat;
> 	}
>
> 	public String getAddress1() {
> 		return this.address1;
> 	}
>
> 	public void setAddress1(String address1) {
> 		this.address1 = address1;
> 	}
>
> 	public String getAddress2() {
> 		return this.address2;
> 	}
>
> 	public void setAddress2(String address2) {
> 		this.address2 = address2;
> 	}
>
> 	public String getAltphoneneumber() {
> 		return this.altphoneneumber;
> 	}
>
> 	public void setAltphoneneumber(String altphoneneumber) {
> 		this.altphoneneumber = altphoneneumber;
> 	}
>
> 	public String getBilltotype() {
> 		return this.billtotype;
> 	}
>
> 	public void setBilltotype(String billtotype) {
> 		this.billtotype = billtotype;
> 	}
>
> 	public String getChartnumber() {
> 		return this.chartnumber;
> 	}
>
> 	public void setChartnumber(String chartnumber) {
> 		this.chartnumber = chartnumber;
> 	}
>
> 	public String getCity() {
> 		return this.city;
> 	}
>
> 	public void setCity(String city) {
> 		this.city = city;
> 	}
>
> 	public String getCountry() {
> 		return this.country;
> 	}
>
> 	public void setCountry(String country) {
> 		this.country = country;
> 	}
>
> 	public Date getDateofbirth() {
> 		return this.dateofbirth;
> 	}
>
> 	public void setDateofbirth(Date dateofbirth) {
> 		this.dateofbirth = dateofbirth;
> 	}
>
> 	public String getDriverslicense() {
> 		return this.driverslicense;
> 	}
>
> 	public void setDriverslicense(String driverslicense) {
> 		this.driverslicense = driverslicense;
> 	}
>
> 	public String getEmailaddress() {
> 		return this.emailaddress;
> 	}
>
> 	public void setEmailaddress(String emailaddress) {
> 		this.emailaddress = emailaddress;
> 	}
>
> 	public String getFirstname() {
> 		return this.firstname;
> 	}
>
> 	public void setFirstname(String firstname) {
> 		this.firstname = firstname;
> 	}
>
> 	public String getGender() {
> 		return this.gender;
> 	}
>
> 	public void setGender(String gender) {
> 		this.gender = gender;
> 	}
>
> 	public String getLanguage() {
> 		return this.language;
> 	}
>
> 	public void setLanguage(String language) {
> 		this.language = language;
> 	}
>
> 	public String getLasteligibilityresult() {
> 		return this.lasteligibilityresult;
> 	}
>
> 	public void setLasteligibilityresult(String lasteligibilityresult) {
> 		this.lasteligibilityresult = lasteligibilityresult;
> 	}
>
> 	public String getLasteligibilityresultobm() {
> 		return this.lasteligibilityresultobm;
> 	}
>
> 	public void setLasteligibilityresultobm(String lasteligibilityresultobm) {
> 		this.lasteligibilityresultobm = lasteligibilityresultobm;
> 	}
>
> 	public Timestamp getLasteligibilitytimestamp() {
> 		return this.lasteligibilitytimestamp;
> 	}
>
> 	public void setLasteligibilitytimestamp(Timestamp lasteligibilitytimestamp)
> {
> 		this.lasteligibilitytimestamp = lasteligibilitytimestamp;
> 	}
>
> 	public Timestamp getLasteligibilitytimestampobm() {
> 		return this.lasteligibilitytimestampobm;
> 	}
>
> 	public void setLasteligibilitytimestampobm(Timestamp
> lasteligibilitytimestampobm) {
> 		this.lasteligibilitytimestampobm = lasteligibilitytimestampobm;
> 	}
>
> 	public Timestamp getLasteligibilityverification() {
> 		return this.lasteligibilityverification;
> 	}
>
> 	public void setLasteligibilityverification(Timestamp
> lasteligibilityverification) {
> 		this.lasteligibilityverification = lasteligibilityverification;
> 	}
>
> 	public Timestamp getLasteligibilityverificationobm() {
> 		return this.lasteligibilityverificationobm;
> 	}
>
> 	public void setLasteligibilityverificationobm(Timestamp
> lasteligibilityverificationobm) {
> 		this.lasteligibilityverificationobm = lasteligibilityverificationobm;
> 	}
>
> 	public String getLastname() {
> 		return this.lastname;
> 	}
>
> 	public void setLastname(String lastname) {
> 		this.lastname = lastname;
> 	}
>
> 	public String getMaritalstatus() {
> 		return this.maritalstatus;
> 	}
>
> 	public void setMaritalstatus(String maritalstatus) {
> 		this.maritalstatus = maritalstatus;
> 	}
>
> 	public String getMiddleinitial() {
> 		return this.middleinitial;
> 	}
>
> 	public void setMiddleinitial(String middleinitial) {
> 		this.middleinitial = middleinitial;
> 	}
>
> 	public Timestamp getModifiedat() {
> 		return this.modifiedat;
> 	}
>
> 	public void setModifiedat(Timestamp modifiedat) {
> 		this.modifiedat = modifiedat;
> 	}
>
> 	public String getNameofspouse() {
> 		return this.nameofspouse;
> 	}
>
> 	public void setNameofspouse(String nameofspouse) {
> 		this.nameofspouse = nameofspouse;
> 	}
>
> 	public String getPatientnumber() {
> 		return this.patientnumber;
> 	}
>
> 	public void setPatientnumber(String patientnumber) {
> 		this.patientnumber = patientnumber;
> 	}
>
> 	public String getPhonenumber() {
> 		return this.phonenumber;
> 	}
>
> 	public void setPhonenumber(String phonenumber) {
> 		this.phonenumber = phonenumber;
> 	}
>
> 	public String getSsn() {
> 		return this.ssn;
> 	}
>
> 	public void setSsn(String ssn) {
> 		this.ssn = ssn;
> 	}
>
> 	public String getState() {
> 		return this.state;
> 	}
>
> 	public void setState(String state) {
> 		this.state = state;
> 	}
>
> 	public String getZip() {
> 		return this.zip;
> 	}
>
> 	public void setZip(String zip) {
> 		this.zip = zip;
> 	}
>
> 	public Patientemployer getPatientemployer() {
> 		return this.patientemployer;
> 	}
>
> 	public void setPatientemployer(Patientemployer patientemployer) {
> 		this.patientemployer = patientemployer;
> 	}
>
> 	public List<Workerscompclaim> getWorkerscompclaims() {
> 		return workerscompclaims;
> 	}
>
> 	public void setWorkerscompclaims(List<Workerscompclaim> workerscompclaims)
> {
> 		this.workerscompclaims = workerscompclaims;
> 	}
>
> }
>
> Can you tell me if there is a possible workaround should this prove to be a
> postgresql issue?
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/FIQL-error-unterminated-quoted-string-at-or-near-tp5733495p5733520.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: FIQL error unterminated quoted string at or near "'\')"

Posted by gsilverman <gl...@pssd.com>.
Thanks for replying. We are using Postgresql v 9 and I can't change that.
Here is my patient entity class. It's nothing special:

@Entity
@Table(name="patients")
public class Patient implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String patientid;

	private Boolean active;

	@Temporal(TemporalType.DATE)
	private Date addedat;

	private String address1;

	private String address2;

	private String altphoneneumber;

	private String billtotype;

	private String chartnumber;

	private String city;

	private String country;

	@Temporal(TemporalType.DATE)
	private Date dateofbirth;

	private String driverslicense;

	private String emailaddress;

	private String firstname;

	private String gender;

	private String language;

	private String lasteligibilityresult;

	private String lasteligibilityresultobm;

	private Timestamp lasteligibilitytimestamp;

	private Timestamp lasteligibilitytimestampobm;

	private Timestamp lasteligibilityverification;

	private Timestamp lasteligibilityverificationobm;

	private String lastname;

	private String maritalstatus;

	private String middleinitial;

	private Timestamp modifiedat;

	private String nameofspouse;

	private String patientnumber;

	private String phonenumber;

	private String ssn;

	private String state;

	private String zip;

	//bi-directional many-to-one association to Patientemployer
	@ManyToOne
	@JoinColumn(name="patientemployerid")
	private Patientemployer patientemployer;
	
	@OneToMany(mappedBy = "patient", fetch = FetchType.LAZY)
	private List<Workerscompclaim> workerscompclaims;

	public Patient() {
	}

	public String getPatientid() {
		return this.patientid;
	}

	public void setPatientid(String patientid) {
		this.patientid = patientid;
	}

	public Boolean getActive() {
		return this.active;
	}

	public void setActive(Boolean active) {
		this.active = active;
	}

	public Date getAddedat() {
		return this.addedat;
	}

	public void setAddedat(Date addedat) {
		this.addedat = addedat;
	}

	public String getAddress1() {
		return this.address1;
	}

	public void setAddress1(String address1) {
		this.address1 = address1;
	}

	public String getAddress2() {
		return this.address2;
	}

	public void setAddress2(String address2) {
		this.address2 = address2;
	}

	public String getAltphoneneumber() {
		return this.altphoneneumber;
	}

	public void setAltphoneneumber(String altphoneneumber) {
		this.altphoneneumber = altphoneneumber;
	}

	public String getBilltotype() {
		return this.billtotype;
	}

	public void setBilltotype(String billtotype) {
		this.billtotype = billtotype;
	}

	public String getChartnumber() {
		return this.chartnumber;
	}

	public void setChartnumber(String chartnumber) {
		this.chartnumber = chartnumber;
	}

	public String getCity() {
		return this.city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getCountry() {
		return this.country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public Date getDateofbirth() {
		return this.dateofbirth;
	}

	public void setDateofbirth(Date dateofbirth) {
		this.dateofbirth = dateofbirth;
	}

	public String getDriverslicense() {
		return this.driverslicense;
	}

	public void setDriverslicense(String driverslicense) {
		this.driverslicense = driverslicense;
	}

	public String getEmailaddress() {
		return this.emailaddress;
	}

	public void setEmailaddress(String emailaddress) {
		this.emailaddress = emailaddress;
	}

	public String getFirstname() {
		return this.firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public String getGender() {
		return this.gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getLanguage() {
		return this.language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	public String getLasteligibilityresult() {
		return this.lasteligibilityresult;
	}

	public void setLasteligibilityresult(String lasteligibilityresult) {
		this.lasteligibilityresult = lasteligibilityresult;
	}

	public String getLasteligibilityresultobm() {
		return this.lasteligibilityresultobm;
	}

	public void setLasteligibilityresultobm(String lasteligibilityresultobm) {
		this.lasteligibilityresultobm = lasteligibilityresultobm;
	}

	public Timestamp getLasteligibilitytimestamp() {
		return this.lasteligibilitytimestamp;
	}

	public void setLasteligibilitytimestamp(Timestamp lasteligibilitytimestamp)
{
		this.lasteligibilitytimestamp = lasteligibilitytimestamp;
	}

	public Timestamp getLasteligibilitytimestampobm() {
		return this.lasteligibilitytimestampobm;
	}

	public void setLasteligibilitytimestampobm(Timestamp
lasteligibilitytimestampobm) {
		this.lasteligibilitytimestampobm = lasteligibilitytimestampobm;
	}

	public Timestamp getLasteligibilityverification() {
		return this.lasteligibilityverification;
	}

	public void setLasteligibilityverification(Timestamp
lasteligibilityverification) {
		this.lasteligibilityverification = lasteligibilityverification;
	}

	public Timestamp getLasteligibilityverificationobm() {
		return this.lasteligibilityverificationobm;
	}

	public void setLasteligibilityverificationobm(Timestamp
lasteligibilityverificationobm) {
		this.lasteligibilityverificationobm = lasteligibilityverificationobm;
	}

	public String getLastname() {
		return this.lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public String getMaritalstatus() {
		return this.maritalstatus;
	}

	public void setMaritalstatus(String maritalstatus) {
		this.maritalstatus = maritalstatus;
	}

	public String getMiddleinitial() {
		return this.middleinitial;
	}

	public void setMiddleinitial(String middleinitial) {
		this.middleinitial = middleinitial;
	}

	public Timestamp getModifiedat() {
		return this.modifiedat;
	}

	public void setModifiedat(Timestamp modifiedat) {
		this.modifiedat = modifiedat;
	}

	public String getNameofspouse() {
		return this.nameofspouse;
	}

	public void setNameofspouse(String nameofspouse) {
		this.nameofspouse = nameofspouse;
	}

	public String getPatientnumber() {
		return this.patientnumber;
	}

	public void setPatientnumber(String patientnumber) {
		this.patientnumber = patientnumber;
	}

	public String getPhonenumber() {
		return this.phonenumber;
	}

	public void setPhonenumber(String phonenumber) {
		this.phonenumber = phonenumber;
	}

	public String getSsn() {
		return this.ssn;
	}

	public void setSsn(String ssn) {
		this.ssn = ssn;
	}

	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getZip() {
		return this.zip;
	}

	public void setZip(String zip) {
		this.zip = zip;
	}

	public Patientemployer getPatientemployer() {
		return this.patientemployer;
	}

	public void setPatientemployer(Patientemployer patientemployer) {
		this.patientemployer = patientemployer;
	}

	public List<Workerscompclaim> getWorkerscompclaims() {
		return workerscompclaims;
	}

	public void setWorkerscompclaims(List<Workerscompclaim> workerscompclaims)
{
		this.workerscompclaims = workerscompclaims;
	}

}

Can you tell me if there is a possible workaround should this prove to be a
postgresql issue?



--
View this message in context: http://cxf.547215.n5.nabble.com/FIQL-error-unterminated-quoted-string-at-or-near-tp5733495p5733520.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: FIQL error unterminated quoted string at or near "'\')"

Posted by Sergey Beryozkin <sb...@gmail.com>.
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.
>