开发者

How to add fields to entities in the roo-shell?

I'd like to add fields to an already created entity in the roo-s开发者_Python百科hell but I don't know which command puts an entity in the current context.

Which one does that?


You have to "focus" that class first to add or change fields on it

roo> focus --class ~.LaserCannon
~.LaserCannon roo> field number --fieldName strength --type double
Updated SRC_MAIN_JAVA/com/stackoverflow/LaserCannon.java
Updated SRC_MAIN_JAVA/com/stackoverflow/LaserCannon_Roo_JavaBean.aj
Updated SRC_MAIN_JAVA/com/stackoverflow/LaserCannon_Roo_ToString.aj

Which added field "strength" to my class com.stackoverflow.LaserCannon (~ is evaluated by roo to your project's top-level-package)


You can use the "--class" attribute in the "field" command as well.

In the roo console use the tab key for suggestion with the commands (or ctrl+space in the STS [even in Mac])

See Field Commands reference

For instance:

roo> field string --fieldName borrar --class ~.domain.Comercio
Updated SRC_MAIN_JAVA\com\malsolo\stackoverflow\domain\Comercio.java
Updated SRC_MAIN_WEBAPP\WEB-INF\i18n\application.properties
Updated SRC_MAIN_JAVA\com\malsolo\stackoverflow\domain\Comercio_Roo_JavaBean.aj
Updated SRC_MAIN_JAVA\com\malsolo\stackoverflow\domain\Comercio_Roo_ToString.aj
Updated SRC_TEST_JAVA\com\malsolo\stackoverflow\domain\ComercioDataOnDemand_Roo_DataOnDemand.aj
Updated SRC_MAIN_WEBAPP\WEB-INF\views\stack\comercios\list.jspx
Updated SRC_MAIN_WEBAPP\WEB-INF\views\stack\comercios\show.jspx
Updated SRC_MAIN_WEBAPP\WEB-INF\views\stack\comercios\create.jspx
Updated SRC_MAIN_WEBAPP\WEB-INF\views\stack\comercios\update.jspx
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜