OpenJPA
  1. OpenJPA
  2. OPENJPA-956 OpenJPA 2.0 iteration 5 primary task
  3. OPENJPA-1016

JPA2 Query support for embeddables; nested embeddables; relationships from embeddables

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M2
    • Fix Version/s: 2.0.0-M2
    • Component/s: jpa
    • Labels:
      None

      Activity

      Hide
      Catalina Wei added a comment -

      1. Because embeddable object will always have an owning entity, it brings up a question whether query result should materialize the owning entity. Materializing owning entity has undesired side effects; if owning entity has any eager fields, additional SQL is generated which bring in data that is not requested by query.

      if Person entity has an embeddable address field - "Address" is Embeddable class,
      the following query returns Address objects of all Person:

      select p.address from Person p

      In processing the above query, Person should not be materialized, nor any eager fields/relations of Person.

      For this reason, it is decided that if query is selecting embeddable objects, we only retrieve the primary key of the owning entity and save that owner id within the StateManagerImpl instance of the embeddable object.

      2. Our current implementation that supports embeddable class is not OO style.
      Strong-typing by introducing EmbeddedStateManager would be beneficial in the long run.
      But this kind of structural change has big impact to kernal, cache, attach/detache, etc.

      Show
      Catalina Wei added a comment - 1. Because embeddable object will always have an owning entity, it brings up a question whether query result should materialize the owning entity. Materializing owning entity has undesired side effects; if owning entity has any eager fields, additional SQL is generated which bring in data that is not requested by query. if Person entity has an embeddable address field - "Address" is Embeddable class, the following query returns Address objects of all Person: select p.address from Person p In processing the above query, Person should not be materialized, nor any eager fields/relations of Person. For this reason, it is decided that if query is selecting embeddable objects, we only retrieve the primary key of the owning entity and save that owner id within the StateManagerImpl instance of the embeddable object. 2. Our current implementation that supports embeddable class is not OO style. Strong-typing by introducing EmbeddedStateManager would be beneficial in the long run. But this kind of structural change has big impact to kernal, cache, attach/detache, etc.
      Hide
      Michael Dick added a comment -

      Should this be considered for future releases of OpenJPA? Seems odd to close as fixed with no changes, or was this resolved with revision 761031?

      Show
      Michael Dick added a comment - Should this be considered for future releases of OpenJPA? Seems odd to close as fixed with no changes, or was this resolved with revision 761031?

        People

        • Assignee:
          Catalina Wei
          Reporter:
          Catalina Wei
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development