Toplink generate the SQL statement correctly but it does not return any row

Hi
I faced an strange problem when using Toplink as JPA provider. Following snippet shows how I create and execute a query using Toplink JPA:
q = em.createQuery("SELECT B FROM Branch B WHERE B.street LIKE :street");
q.setParameter("street", "'%a%'");
   List<Branch> l = q.getResultList();
  System.out.println("List Size: " + l.size());The SQL statement resulted by this query is as follow (according to the generated log file)
SELECT ID, STREET FROM BRANCH WHERE (STREET LIKE CAST (? AS VARCHAR(32672) ))
  bind => [%a%]Problem is that List size is always 0, independent of what I provide as parameter. I tried and executed the generated SQL statement in the SQL manager and I got some tens of record as the result. The SQL statement i tested in the SQL manager is like:
SELECT ID, STREET FROM BRANCH WHERE (STREET LIKE CAST ('%a%' AS VARCHAR(32672) ))Can someone please let me know what I am missing and how I can fix this problem?
Thanks.

Hi,
Thank you for reply.
All data are stored in lower case so, the case sensitivity is not a problem. I am wondering how the generated query works fine when I execute it in the sql manager but it return no result when it is executed by the JPA.
Thanks for looking into my problem.

Similar Messages

Maybe you are looking for

  • Error message when opening a .cp file (version issue?)

    I am using Captivate 4.0 and exporting to a .swf file. My project partner is using Captivate 3.0 I sent her my Captivate file to use as a template for our project and when she tries to open it, she gets an error message: Adobe Captivate could not ope

  • How to relocate table in new tablespace in Oracle 8i

    Hi all I would like to know how to relocate table from one tablespace to another tablespace in Oracle 8i. Currently, I create new table without data in new tablespace and then load data from old table in old tablespace. However, I think it is not eff

  • Problem starting R/3

    Hello, I am having an issue starting up a 640 R/3 instance. The problem is that I am seeing no errors in the log file. The last entry is Starting Programs but the message server and dispatcher do not get launched (a symbolic link does get created but

  • Accordion widget in document template

    I'm trying to design my site using an accordion widget for my left-side navigation bar: each tab is a product category and when you click it, it shows all the subcategories. When I was working on just the index page, the accordion worked fine every t

  • Help!! My Safari can't launch

    I just bought a iPad yesterday and tried to launch the safari today but it just won't launch even after i have restarted a few times. My firmware is 4.2.1