Creating a List<> Member with Spring Roo

狂风中的少年 提交于 2019-12-10 12:33:45

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!