Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2.5.RELEASE
-
Fix Version/s: 1.3.0.RELEASE
-
Component/s: JSF
-
Labels:None
-
Pull Request URL:
Description
In case the JPA entity has a field which is of type java.util.List instead of java.util.Set, the managed bean aspect is generated incorrectly and causes compile errors.
Steps to reproduce:
project --topLevelPackage org.example.spring jpa setup --provider HIBERNATE --database MYSQL entity jpa --class org.example.spring.Foo entity jpa --class org.example.spring.Bar focus --class ~.Foo field list --fieldName bars --type ~.Bar web jsf setup --implementation ORACLE_MOJARRA --library PRIMEFACES web jsf all --package ~.bean
Results in an aspect called FooBean_Roo_ManagedBean which includes the following method:
public void FooBean.setSelectedBars(List<Bar> selectedBars) { if (selectedBars != null) { foo.setBars(new HashSet<Bar>(selectedBars)); } this.selectedBars = selectedBars; }
which should be
public void FooBean.setSelectedBars(List<Bar> selectedBars) { if (selectedBars != null) { foo.setBars(new ArrayList<Bar>(selectedBars)); } this.selectedBars = selectedBars; }
The pull request for this issue is created, the url is attached.