Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1024

The generated scaffold may fail to compile when array-typed fields are present in the JPA entities

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 1.4.0.Final
    • 1.3.3.Final
    • Scaffold
    • None

    Description

      This is from the Sakila-h2 model and happens occasionally in this model depending on JPA field order in the Staff class, but could be more frequent in other models.

      The scaffold generator is unable to distinguish between array types and corresponding primitive types, thus resulting in code that is syntactically invalid, like:

            byte picture = this.example.getPicture();
            if (picture != 0)
            {
               predicatesList.add(builder.equal(root.get("picture"), picture));
            }
      

      where the picture field in the JPA entity is of type byte[].

      This also seems related to FORGE-918 where information about array-types is lost.

      Attachments

        1. Staff.java
          4 kB
        2. StaffBean.java
          8 kB

        Issue Links

          Activity

            People

              vineet.reynolds_jira Vineet Reynolds (Inactive)
              bsutter@redhat.com Burr Sutter
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: