You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "axel becker (JIRA)" <ji...@apache.org> on 2013/09/26 10:29:02 UTC

[jira] [Created] (OPENJPA-2431) Native-Query with multiple joins to same table returning wrong result

axel becker created OPENJPA-2431:
------------------------------------

             Summary: Native-Query with multiple joins to same table returning wrong result
                 Key: OPENJPA-2431
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2431
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc, jpa, kernel, sql
    Affects Versions: 2.1.1, 2.1.0
         Environment: Websphere 8 Runtime and ApplicationServer
Windows XP
J2EE 6
Oracle 11
            Reporter: axel becker
            Priority: Critical


The resultset of the following native query should has a result of an objectarray with 3 different returnvalues. 
1) TestEntityIndexReadonly: the holder entity mapped to table indexes 
2) TestEntityCurrencyReadonly: currency mapped to table types 
3) TestEntityTenorReadonly: tenor mapped to table types too 

But i get an Resultset with 3 Objects where the second and the third object are the same (same instance). 
1) TestEntityIndexReadonly: 
2) TestEntityCurrencyReadonly: 
3) TestEntityCurrencyReadonly: 

Hint: For the entity-3 i get the same oid as for entity-2. The reason is, the JDBCStoreManager (Line 1031) "Object oid = base.getObjectId(this, result, null, true, null);" gets the same oid for entity-2 and entity-3. 

I will attache the javaclasses and mapping.xml and a screen from the wrong resultset. 

see also: https://issues.apache.org/jira/browse/openjpa-2218. 

I tried to find out a workaround by removing the abstract parent from TestEntityCurrencyReadonly and TestEntityTenorReadonly. 
In this case, i get the correct Objectinstances but the third entity (TestEntityTenorReadonly) holds the values from TestEntityCurrencyReadonly (also wrong)! 

--
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