openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Albert Lee <allee8...@gmail.com>
Subject Re: [jira] [Created] (OPENJPA-2426) LIKE operator fails with Postgresql v 9.1
Date Thu, 05 Sep 2013 14:06:14 GMT
>From OPENJPA-2056, the dictionary defines searchStringEscape String depends
on the Postgres version and the LIKE clause uses the corresponding escape
sequence since supportsMultipleNontransactionalResultSets is set to true.

I don't see any LIKE syntax in the sample query ("SELECT p FROM Patient p
where p.lastname = :lastname"). How is the LIKE behavior plays in this
scenario?  What is not working?

Can you create a JUnit to demonstrate the problem?

Albert Lee.


On Wed, Sep 4, 2013 at 5:02 PM, Glenn Silverman (JIRA) <jira@apache.org>wrote:

> Glenn Silverman created OPENJPA-2426:
> ----------------------------------------
>
>              Summary: LIKE operator fails with Postgresql v 9.1
>                  Key: OPENJPA-2426
>                  URL: https://issues.apache.org/jira/browse/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, https://issues.apache.org/jira/browse/OPENJPA-2056,
> 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: http://www.atlassian.com/software/jira
>



-- 
Albert Lee.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message