openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Razuvaev (JIRA)" <>
Subject [jira] [Created] (OPENJPA-2037) Queries with nullable parameters discontinue to return data
Date Thu, 28 Jul 2011 13:13:09 GMT
Queries with nullable parameters discontinue to return data

                 Key: OPENJPA-2037
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 2.1.1
            Reporter: Sergey Razuvaev

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 = :locationSuperLocationId</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
Step 2: Fill locationSuperLocationId with actual parent id and execute query. Repeat this
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:


View raw message