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

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

      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.

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

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

              Created:
              Updated:
              Resolved: