openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Razuvaev (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-2037) Queries with nullable parameters discontinue to return data
Date Sat, 30 Jul 2011 10:53:09 GMT

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

Sergey Razuvaev commented on OPENJPA-2037:
------------------------------------------

Yes, it helped. Thanks a lot, Michael!

> Queries with nullable parameters discontinue to return data
> -----------------------------------------------------------
>
>                 Key: OPENJPA-2037
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2037
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.1.1
>            Reporter: Sergey Razuvaev
>         Attachments: execution_log.txt, jpa_config.txt, table_ scheme.GIF
>
>
> We have a hierarchical table CT_LOCATION (database scheme and corresponding jpa configuration
are placed into table_scheme.gif and jpa_config.txt attachments)
> There is a JPQL-query to get children by a parent location:
>     <named-query name="locationManagement.getLocations">
> 		<query>select item from Location item where item.superLocation.id = :locationSuperLocationId</query>
>     </named-query>
> The parameter locationSuperLocationId can be set to NULL to return all root locations.
When we use following execution sequence the query discontinues to return root items:
> Step 1: Set locationSuperLocationId to NULL and get all root elements. Query result is
NOT EMPTY.
> Step 2: Fill locationSuperLocationId with actual parent id and execute query. Repeat
this step TWO OR MORE TIMES.
> Step 3: Set locationSuperLocationId to NULL again and get all root elements. The query
result will be EMPTY.
> On step 1 openjpa uses IS NULL construction to get data from the database. But on step
3 it does not. Execution log is placed in to execution_log.txt atachment.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message