Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.2.5.RELEASE
-
None
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.