You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "sharath.h (JIRA)" <ji...@apache.org> on 2007/04/14 01:17:15 UTC

[jira] Updated: (OPENJPA-217) query param value issue in select query

     [ https://issues.apache.org/jira/browse/OPENJPA-217?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

sharath.h updated OPENJPA-217:
------------------------------

    Description: 
Consider a scenario where we have an entity class as shown below:
class A
{
 long id;
String str1;
String str2;
}
Say for str2 attribute there will be length constraint something like 
<basic name="str2" >
          <column name="col2"  length="4"/>        
 </basic>

Now say i have a jpql select query as shown below :
Query q = em.createQuery("select t from A t where t.str2:paramvalue");
q.setParameter("paramvalue", "23");

The above query return empty result set even though the records are present in table.
But when i set the value from "23" to "23  " (i.e. with trailing 2 spaces) it works.


Can the padding of additional empty spaces be taken care default by jpa itself for select kind of queries.



  was:
Consider a scenario where we have an entity class as shown below:
class A
{
 long id;
String str1;
String str2;
}
Say for str2 attribute there will be length constraint something like 
<basic name="str2" >
          <column name="col2"  length="4"/>        
 </basic>

Now say i have a jpql select query as shown below :
Query q = em.createQuery("select t from A t where t.str2:paramvalue");
q.setParameter("paramvalue", "23");

The above query return empty result set even though the records are present in table.
But when i set the value from "23" to "23  " (i.e. with trailing 2 spaces).


Can the padding of additional empty spaces be taken care default by jpa itself for select kind of queries.




> query param value issue in select query
> ---------------------------------------
>
>                 Key: OPENJPA-217
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-217
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa, query
>    Affects Versions: 0.9.6
>            Reporter: sharath.h
>            Priority: Minor
>
> Consider a scenario where we have an entity class as shown below:
> class A
> {
>  long id;
> String str1;
> String str2;
> }
> Say for str2 attribute there will be length constraint something like 
> <basic name="str2" >
>           <column name="col2"  length="4"/>        
>  </basic>
> Now say i have a jpql select query as shown below :
> Query q = em.createQuery("select t from A t where t.str2:paramvalue");
> q.setParameter("paramvalue", "23");
> The above query return empty result set even though the records are present in table.
> But when i set the value from "23" to "23  " (i.e. with trailing 2 spaces) it works.
> Can the padding of additional empty spaces be taken care default by jpa itself for select kind of queries.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.