问题
The Spring Roo command field set
creates a Set<> member.
field set --fieldName --type
How does one go about creating a List<> instead?
回答1:
From the latest relese(1.2.4) onwards roo supports lists.
field list --fieldname -- type
回答2:
What is your persistence implementation? Are you using JPA or JDO? Hibernate (JPA provider) will technically "support" lists but makes no guarantee as to the order returned (maintaining order in a database doesn't come for free) and so you may as well use a Set.
It's possible that Roo doesn't bother with lists under that reasoning.
回答3:
I just change it in the java code from set to list. If the roo console is open, It updates automatically .aj files. It just works.
来源:https://stackoverflow.com/questions/6222552/creating-a-list-member-with-spring-roo