You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Rick Curtis (JIRA)" <ji...@apache.org> on 2013/09/05 15:52:52 UTC

[jira] [Commented] (OPENJPA-2426) LIKE operator fails with Postgresql v 9.1

    [ https://issues.apache.org/jira/browse/OPENJPA-2426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13759076#comment-13759076 ] 

Rick Curtis commented on OPENJPA-2426:
--------------------------------------

I'm somewhat confused. It seems that you opened this JIRA because you can't get a query using LIKE to work, but you're also having problems executing a simple query also? If that is the case, lets start out by looking at the simple query. What happens when you execute the query? If nothing happens, you could try to enable trace[1] to see if that sheds any light on what is going on.

Thanks,
Rick

[1] 
<property name="openjpa.Log" value="DefaultLevel=trace"/> 
<property name="openjpa.ConnectionFactoryProperties" value="PrintParameters=true"/>  <!-- This property enables tracing of SQL parameters -->
                
> 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
>              Labels: Aries, JPA
>
> 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