OpenJPA
  1. OpenJPA
  2. OPENJPA-859

OpenJPA requires all persistent fields to be specified on an XML defined entity

    Details

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

      Description

      This problem was reported by Frank Schwarz on the user forum[1]. It appeared to be related to the use of the new element-collection element in XML, but is actually are result of not having all persistent fields defined in XML. If all fields are defined - or the entity is simply annotated with @Entity no exception is thrown.

      Based on the JPA spec:

      2.1.1 - If the entity has field-based access, the persistence provider runtime accesses instance variables
      directly. All non-transient instance variables that are not annotated with the Transient
      annotation are persistent. When field-based access is used, the object/relational mapping annotations
      for the entity class annotate the instance variables.

      In addition, the <entity> xsd documentation states: [entity] Defines the settings and mappings for an entity. Is allowed to be
      sparsely populated and used in conjunction with the annotations.

      [1] http://n2.nabble.com/orm.xml---element-collection---trunk-tp2142331p2142331.html

        Activity

        Hide
        Rick Curtis added a comment -

        1.3.x – Committed revision 818927,818932.
        trunk – Committed revision 818928.

        Show
        Rick Curtis added a comment - 1.3.x – Committed revision 818927,818932. trunk – Committed revision 818928.
        Hide
        Rick Curtis added a comment -

        Changes committed to trunk.

        Show
        Rick Curtis added a comment - Changes committed to trunk.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development