I'd like to add fields to an already created entity in the roo-shell 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With