OpenJPA
  1. OpenJPA
  2. OPENJPA-1893

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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.

      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

        Fay Wang made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Fay Wang made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.1.0 [ 12314542 ]
        Resolution Fixed [ 1 ]
        Fay Wang made changes -
        Assignee Fay Wang [ faywang ]
        Patrice DUROUX made changes -
        Field Original Value New Value
        Attachment Attribute.java [ 12460184 ]
        Attachment Feature.java [ 12460185 ]
        Attachment FeatureId.java [ 12460186 ]
        Hide
        Patrice DUROUX added a comment -

        Here are the corresponding Java classes.

        Show
        Patrice DUROUX added a comment - Here are the corresponding Java classes.
        Hide
        Fay Wang added a comment -

        Hi Patrice,
        Could you post your Feature.java, your embedded id class, and embeddable class used in the element collection? Thanks!

        Show
        Fay Wang added a comment - Hi Patrice, Could you post your Feature.java, your embedded id class, and embeddable class used in the element collection? Thanks!
        Patrice DUROUX created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development