解决方法
Roo的字段枚举–fieldName –type命令添加指定枚举类型的私有字段.
您可以手动创建枚举类型或使用roo命令:
@H_301_14@roo> enum type --class ~.domain.Colors roo> enum constant --name BLAU roo> enum constant --name VERMELL这将创建一个颜色枚举:
@H_301_14@public Enum Colors { BLAU,VERMELL }然后可以使用枚举类型来定义实体字段:
@H_301_14@roo> entity --class ~.domain.Foo roo> field enum --fieldName color --type ~.domain.Colors这将定义Foo实体:
@H_301_14@//Annotations and imports ommited for brevity public class Foo{ private Colors color; }有关roo命令的完整参考,请参见http://static.springsource.org/spring-roo/reference/html/command-index.html.