Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1674

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.0
    • Fix Version/s: None
    • Component/s: sql
    • Labels:
      None
    • Environment:
      Windows 7 / CentOS 5.4, MySQL 5.1

      Description

      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.

        Attachments

        1. OPENJPA-1674_test.patch
          8 kB
          Jeremy Bauer

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              crispyoz Christopher Davies
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: