You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Christopher Davies (JIRA)" <ji...@apache.org> on 2010/05/24 20:06:23 UTC

[jira] Created: (OPENJPA-1674) OpenJPA is not differentiating between entity types with the same key when I use table per class.

OpenJPA is not differentiating between entity types with the same key when I use table per class.
-------------------------------------------------------------------------------------------------

                 Key: OPENJPA-1674
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1674
             Project: OpenJPA
          Issue Type: Bug
          Components: sql
    Affects Versions: 2.0.0
         Environment: Windows 7 / CentOS 5.4, MySQL 5.1
            Reporter: Christopher Davies


OpenJPA is not differentiating between entity types with the same key when I use table per class.

Here's a snippet of my ode, 

            (Department) es.find(Department.class, "N/A");
            (PrintQueue) es.find(PrintQueue.class, "N/A");

Both Department and PrintQueue entities are based upon the same super class but I use table per class so they are in separate tables.

As you can see they both have the same key, but if I put the department line 1st the find of the print queue will generate a class cast exception trying to cast a Department to a PrintQueue. If I put the PrintQueue line 1st I will get a class cast exception trying to cast a PrintQueue to  a Department.  The second find doesn't generate any SQL  if I have trace logging turned on so it looks to me that it is a cache issue. 



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


[jira] Updated: (OPENJPA-1674) OpenJPA is not differentiating between entity types with the same key when I use table per class.

Posted by "Jeremy Bauer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeremy Bauer updated OPENJPA-1674:
----------------------------------

    Attachment: OPENJPA-1674_test.patch

I've attached a simple test case for this problem.  It is currently marked @AllowFailure.  Be sure to comment that out in order to get a report of the failure.

> OpenJPA is not differentiating between entity types with the same key when I use table per class.
> -------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1674
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1674
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.0.0
>         Environment: Windows 7 / CentOS 5.4, MySQL 5.1
>            Reporter: Christopher Davies
>         Attachments: OPENJPA-1674_test.patch
>
>
> OpenJPA is not differentiating between entity types with the same key when I use table per class.
> Here's a snippet of my ode, 
>             (Department) es.find(Department.class, "N/A");
>             (PrintQueue) es.find(PrintQueue.class, "N/A");
> Both Department and PrintQueue entities are based upon the same super class but I use table per class so they are in separate tables.
> As you can see they both have the same key, but if I put the department line 1st the find of the print queue will generate a class cast exception trying to cast a Department to a PrintQueue. If I put the PrintQueue line 1st I will get a class cast exception trying to cast a PrintQueue to  a Department.  The second find doesn't generate any SQL  if I have trace logging turned on so it looks to me that it is a cache issue. 

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


[jira] Commented: (OPENJPA-1674) OpenJPA is not differentiating between entity types with the same key when I use table per class.

Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12871012#action_12871012 ] 

Pinaki Poddar commented on OPENJPA-1674:
----------------------------------------

> OpenJPA is not differentiating between entity types with the same key when I use table per class. 
It does if told to do so:
 openjpa.Compatibilty=StrictIdentityValues=true

The attached test will pass with the above config.

> OpenJPA is not differentiating between entity types with the same key when I use table per class.
> -------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1674
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1674
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.0.0
>         Environment: Windows 7 / CentOS 5.4, MySQL 5.1
>            Reporter: Christopher Davies
>         Attachments: OPENJPA-1674_test.patch
>
>
> OpenJPA is not differentiating between entity types with the same key when I use table per class.
> Here's a snippet of my ode, 
>             (Department) es.find(Department.class, "N/A");
>             (PrintQueue) es.find(PrintQueue.class, "N/A");
> Both Department and PrintQueue entities are based upon the same super class but I use table per class so they are in separate tables.
> As you can see they both have the same key, but if I put the department line 1st the find of the print queue will generate a class cast exception trying to cast a Department to a PrintQueue. If I put the PrintQueue line 1st I will get a class cast exception trying to cast a PrintQueue to  a Department.  The second find doesn't generate any SQL  if I have trace logging turned on so it looks to me that it is a cache issue. 

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