OpenJPA
  1. OpenJPA
  2. OPENJPA-1485

isLoaded util method does not behave per spec for collection attributes and basic type

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-beta
    • Fix Version/s: 2.0.0-beta2
    • Component/s: None
    • Labels:
      None

      Description

      Section 3.2.9 of the spec states:

      A collection-valued attribute is considered to be loaded if the collection was loaded from the database
      or the value of the attribute was assigned by the application, and, if the attribute references a collection
      instance (i.e., is not null), each element of the collection (e.g. entity or embeddable) is considered to be
      loaded.

      OpenJPA currently does not behave according to spec if an entity is loaded by the DB and the collection attribute is set to null.

        Activity

        Jeremy Bauer created issue -
        Hide
        Fay Wang added a comment -

        A basic type is in the default fetch group. If a fetch plan is used to load an entity, and that fetch plan removes the default fetch group, the basic type will not be loaded. In this case, this basic type should be regarded as lazy loaded. The isLoaded util method should return true for this entity because all eager-fetched attributes are loaded.

        Show
        Fay Wang added a comment - A basic type is in the default fetch group. If a fetch plan is used to load an entity, and that fetch plan removes the default fetch group, the basic type will not be loaded. In this case, this basic type should be regarded as lazy loaded. The isLoaded util method should return true for this entity because all eager-fetched attributes are loaded.
        Fay Wang made changes -
        Field Original Value New Value
        Summary isLoaded util method does not behave per spec for collection attributes isLoaded util method does not behave per spec for collection attributes and basic type
        Jeremy Bauer made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.0 [ 12314019 ]
        Resolution Fixed [ 1 ]
        Donald Woods made changes -
        Fix Version/s 2.0.0-beta2 [ 12314802 ]
        Fix Version/s 2.0.0 [ 12314019 ]
        Affects Version/s 2.0.0-beta [ 12314149 ]
        Affects Version/s 2.0.0 [ 12314019 ]
        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Jeremy Bauer
            Reporter:
            Jeremy Bauer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved:

              Development