openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glenn Silverman (JIRA)" <>
Subject [jira] [Created] (OPENJPA-2426) LIKE operator fails with Postgresql v 9.1
Date Wed, 04 Sep 2013 22:02:52 GMT
Glenn Silverman created OPENJPA-2426:

             Summary: LIKE operator fails with Postgresql v 9.1
                 Key: OPENJPA-2426
             Project: OpenJPA
          Issue Type: Question
          Components: jpa
    Affects Versions: 2.2.2
         Environment: Apache Karaf v 2.3.2 and Aries JPA
            Reporter: Glenn Silverman

I'm getting very discouraged with OpenJPA as it relates to Postgresql v 9.1 and and creating
queries using the LIKE operator.  I know there was an issue a few years back,,
but I've tried everything mentioned there as a workaround 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, the environment I'm running in under Karaf,
even recognizes these property settings.

When I use Hibernate as my persistence provider, I don't have this problem.  I don't want
to give up on OpenJPA in my OSGi environment, but I may have to if no one has a solution.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message