[forge-issues] [JBoss JIRA] (FORGE-1024) The generated scaffold may fail to compile when array-typed fields are present in the JPA entities

Vineet Reynolds (JIRA) jira-events at lists.jboss.org
Fri Jul 19 14:48:26 EDT 2013


     [ https://issues.jboss.org/browse/FORGE-1024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vineet Reynolds updated FORGE-1024:
-----------------------------------

              Summary: The generated scaffold may fail to compile when array-typed fields are present in the JPA entities  (was: Type mismatch: cannot convert from byte[] to byte)
          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:

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

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.
             Priority: Critical  (was: Major)
             Assignee: Vineet Reynolds
    Affects Version/s: 1.3.3.Final
          Component/s: Scaffold


Bumping priority to critical, since this may not be resolvable in all circumstances, and resolving the issue would require manual removal of the offending code as well as the references to the field from the {{search.xhtml}} facelet.
                
> The generated scaffold may fail to compile when array-typed fields are present in the JPA entities
> --------------------------------------------------------------------------------------------------
>
>                 Key: FORGE-1024
>                 URL: https://issues.jboss.org/browse/FORGE-1024
>             Project: Forge
>          Issue Type: Bug
>          Components: Scaffold
>    Affects Versions: 1.3.3.Final
>            Reporter: Burr Sutter
>            Assignee: Vineet Reynolds
>            Priority: Critical
>         Attachments: Staff.java, StaffBean.java
>
>
> 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:
> {noformat}
>       byte picture = this.example.getPicture();
>       if (picture != 0)
>       {
>          predicatesList.add(builder.equal(root.get("picture"), picture));
>       }
> {noformat}
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the forge-issues mailing list