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

Missing join clause in query with collection-table with two join-columns

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.1.0
    • Component/s: None
    • Labels:
      None

      Description

      Considering the following mapping:

      <entity class="Feature">
      <table name="features" />
      <attributes>
      <embedded-id name="id" />
      <element-collection name="attributes">
      <collection-table name="qualifiers" />
      </element-collection>
      </attributes>
      </entity>

      Without specifying any JoinColumn element in the CollectionTable element, I got the query:

      (...) INNER JOIN qualifiers t3 ON t0.index = t3.FEATURE_INDEX AND t0.oid = t3.FEATURE_OID (...)

      but changing the mapping by:
      <collection-table name="qualifiers">
      <join-column name="oid" />
      <join-column name="index" />
      </collection-table>

      I got:

      (...) INNER JOIN qualifiers t3 ON t0.index = t3.index (...)

      where is missing the first JoinColumn.

        Attachments

        1. Attribute.java
          0.3 kB
          Patrice DUROUX
        2. Feature.java
          0.4 kB
          Patrice DUROUX
        3. FeatureId.java
          0.8 kB
          Patrice DUROUX

          Activity

            People

            • Assignee:
              faywang Fay Wang
              Reporter:
              pduroux Patrice DUROUX
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: