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: query
    • Labels:
      None

      Activity

      Hide
      Catalina Wei added a comment -

      typo in previous comment :
      1. OpenJPA does now allow selection of an abstract entity,
      should be
      1. OpenJPA does NOT allow selection of an abstract entity,

      Show
      Catalina Wei added a comment - typo in previous comment : 1. OpenJPA does now allow selection of an abstract entity, should be 1. OpenJPA does NOT allow selection of an abstract entity,
      Hide
      Catalina Wei added a comment -

      Support for entity type expression in JPA2 has been committed under svn r736881.

      Open issues & limitations:

      1. OpenJPA does now allow selection of an abstract entity, hence
      TYPE(e) if e is mapped to abstract entity class will fail as a user error.

      For example, in using entities defined in org.apache.openjpa.persistence.inheritance.polymorphic package under openjpa-persistence-jdbc test

      the following query results in exception:
      SELECT t.translatable FROM Translation t

      <openjpa-2.0.0-SNAPSHOT-runknown nonfatal user error> org.apache.openjpa.persistence.InvalidStateException: Cannot instantiate virtual mapping "class org.apache.openjpa.persistence.inheritance.polymorphic.Translatable".
      at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.selectBaseMappings(JDBCStoreManager.java:1221)

      for the same reason, the query below fails in the same error:
      SELECT TYPE(t.translatable) FROM Translation t

      2. No tests have been run for entities using JAVA interface classes.
      Do we need to support TYPE(e) where e is referencing JAVA interface class which does have backing entity implementation classes ?
      This is not being addressed in JPA2 Public Draft.

      Show
      Catalina Wei added a comment - Support for entity type expression in JPA2 has been committed under svn r736881. Open issues & limitations: 1. OpenJPA does now allow selection of an abstract entity, hence TYPE(e) if e is mapped to abstract entity class will fail as a user error. For example, in using entities defined in org.apache.openjpa.persistence.inheritance.polymorphic package under openjpa-persistence-jdbc test the following query results in exception: SELECT t.translatable FROM Translation t <openjpa-2.0.0-SNAPSHOT-runknown nonfatal user error> org.apache.openjpa.persistence.InvalidStateException: Cannot instantiate virtual mapping "class org.apache.openjpa.persistence.inheritance.polymorphic.Translatable". at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.selectBaseMappings(JDBCStoreManager.java:1221) for the same reason, the query below fails in the same error: SELECT TYPE(t.translatable) FROM Translation t 2. No tests have been run for entities using JAVA interface classes. Do we need to support TYPE(e) where e is referencing JAVA interface class which does have backing entity implementation classes ? This is not being addressed in JPA2 Public Draft.

        People

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

          Dates

          • Created:
            Updated:
            Resolved:

            Development