OpenJPA
  1. OpenJPA
  2. OPENJPA-828

Externalizer fails with ClassCastException with runtime enhancement

    Details

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

      Description

      Several issues [1] are reported with @Externalizer field failing with ClassCastException. The issue appears only for runtime enhanced classes and not for build time enhancement.

      [1] http://n2.nabble.com/%40Externalizer-does-not-work-on-persist--tt209702.html#a209702

        Issue Links

          Activity

          Show
          Julien Kronegg added a comment - See also this forum thread: http://n2.nabble.com/Convert-boolean-to-String-type-using-ExternalValues-td1659239.html
          Hide
          Julien Kronegg added a comment -

          Got this issue using Boolean->CHAR Y/N mapping for runtime enhanced classes under OpenJPA 1.2.1:

          @Column(name="flag", nullable=true, length=1)
          @ExternalValues(

          {"true=Y", "false=N"}

          )
          @org.apache.openjpa.persistence.Type(char.class)
          public Boolean getFlag()

          { .. }

          Applying changes described in the following edits solved the problem:
          http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ReflectingPersistenceCapable.java?view=diff&r1=726926&r2=726927&pathrev=726927

          This issue should also be solved in 1.2 and 1.3 branches...

          Show
          Julien Kronegg added a comment - Got this issue using Boolean->CHAR Y/N mapping for runtime enhanced classes under OpenJPA 1.2.1: @Column(name="flag", nullable=true, length=1) @ExternalValues( {"true=Y", "false=N"} ) @org.apache.openjpa.persistence.Type(char.class) public Boolean getFlag() { .. } Applying changes described in the following edits solved the problem: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ReflectingPersistenceCapable.java?view=diff&r1=726926&r2=726927&pathrev=726927 This issue should also be solved in 1.2 and 1.3 branches...

            People

            • Assignee:
              Unassigned
              Reporter:
              Pinaki Poddar
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development