Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-6362

SEAM Entity creator uses Integer for @Version - results in NullPointerException on update

    XMLWordPrintable

Details

    • Release Notes
    • Workaround Exists
    • Hide

      Change Integer to int manually after code has been generated.

      Show
      Change Integer to int manually after code has been generated.
    • Hide
      In seam-gen, Entity fields that were annotated by @Version were set as an Integer data type. The Update operation was not compatible with the Integer data type, and terminated with a NullPointerException. The @Version data type has been changed from Integer to int. Entity Update operations now complete successfully.
      Show
      In seam-gen, Entity fields that were annotated by @Version were set as an Integer data type. The Update operation was not compatible with the Integer data type, and terminated with a NullPointerException. The @Version data type has been changed from Integer to int. Entity Update operations now complete successfully.
    • Documented as Resolved Issue
    • ON_QA

    Description

      When creating entities from scratch, the seam-gen new entity will generate code with the the following:

      @Version
      private Integer version;

      This construct unfortunately results in new records being created with NULL in the version column. On subsequent updates this then results in NullPointerException.

      Changing Integer to int solves the problem.

      Attachments

        Issue Links

          Activity

            People

              mnovotny@redhat.com Marek Novotny
              rh-sa-plarsen Peter Larsen
              Jared Morgan Jared Morgan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: