Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.1
    • Labels:
      None

      Description

      In the Java EE 7 downloaded javadocs, the first five samples for @Convert shows an incorrect usage of the annotation. They all use @Convert(BooleanToIntegerConverter.class) or something similar. This should be @Convert(converter=BooleanToIntegerConverter.class).

      This is the case with the hosted javadocs at http://docs.oracle.com/javaee/7/api/javax/persistence/Convert.html as well.

      The exact code snippet from javadocs is given below:

      Example 1: Convert a basic attribute

      @Converter
      public class BooleanToIntegerConverter
      implements AttributeConverter<Boolean, Integer>

      { ... }

      @Entity
      public class Employee { @Id long id; @Convert(BooleanToIntegerConverter.class) boolean fullTime; ... }


      Example 2: Auto-apply conversion of a basic attribute

      @Converter(autoApply=true)
      public class EmployeeDateConverter
      implements AttributeConverter<com.acme.EmployeeDate, java.sql.Date> { ... }

      @Entity
      public class Employee

      { @Id long id; ... // EmployeeDateConverter is applied automatically EmployeeDate startDate; }

      Example 3: Disable conversion in the presence of an autoapply converter

      @Convert(disableConversion=true)
      EmployeeDate lastReview;

      Example 4: Apply a converter to an element collection of basic type

      @ElementCollection
      // applies to each element in the collection
      @Convert(NameConverter.class)
      List<String> names;

      Example 5: Apply a converter to an element collection that is a map or basic values.
      The converter is applied to the map value.

      @ElementCollection
      @Convert(EmployeeNameConverter.class)
      Map<String, String> responsibilities;

        Activity

        arungupta created issue -
        Hide
        ldemichiel added a comment -

        Yes, this is definitely an errata item.

        Show
        ldemichiel added a comment - Yes, this is definitely an errata item.
        ldemichiel made changes -
        Field Original Value New Value
        Assignee ldemichiel [ ldemichiel ]
        Priority Major [ 3 ] Minor [ 4 ]
        Lukas Jungmann made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee ldemichiel [ ldemichiel ] Lukas Jungmann [ jungicz ]
        Fix Version/s 2.1.1 [ 17586 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Lukas Jungmann
            Reporter:
            arungupta
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: