
Originally Posted by
rvauradkar
~.domain.PizzaOrder roo> field number --fieldName total --type java.long.Float
java.long.Float is an illegal type name, because it includes "long" (a reversed word). As such Roo cannot parse the PizzaOrder.java file (as the long is in an illegal location according to the AST) and it thus cannot see whether there are any @Roo annotations. Because it does not know for sure you really want it to write out any ITDs, it removes the ITDs just in case (it will add them back once you fix the syntax error).
This script tests fine, if you want to give it a go:
Code:
project --topLevelPackage org.springframework.forum
persistence setup --provider OPENJPA --database HYPERSONIC_IN_MEMORY
entity --class ~.domain.PizzaOrder --testAutomatically
field string --fieldName name --notNull --sizeMin 2
field string --fieldName address --notNull --sizeMax 30
field number --fieldName total --type java.lang.Float
Output:
Code:
____ ____ ____
/ __ \/ __ \/ __ \
/ /_/ / / / / / / /
/ _, _/ /_/ / /_/ /
/_/ |_|\____/\____/ ENGINEERING BUILD [rev 576]
Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
roo> project --topLevelPackage org.springframework.forum
Created /home/balex/t/pom.xml
Created SRC_MAIN_JAVA
Created SRC_MAIN_RESOURCES
Created SRC_TEST_JAVA
Created SRC_TEST_RESOURCES
Created SRC_MAIN_WEBAPP
Created SRC_MAIN_RESOURCES/META-INF/spring
Created SRC_MAIN_RESOURCES/META-INF/spring/applicationContext.xml
Created SRC_MAIN_RESOURCES/META-INF/spring/log4j.properties
org.springframework.forum roo> persistence setup --provider OPENJPA --database HYPERSONIC_IN_MEMORY
Created SRC_MAIN_RESOURCES/META-INF/persistence.xml
Created SRC_MAIN_RESOURCES/META-INF/spring/database.properties
Managed SRC_MAIN_RESOURCES/META-INF/spring/applicationContext.xml
Managed ROOT/pom.xml
org.springframework.forum roo> entity --class ~.domain.PizzaOrder --testAutomatically
Created SRC_MAIN_JAVA/org/springframework/forum/domain
Created SRC_MAIN_JAVA/org/springframework/forum/domain/PizzaOrder.java
Created SRC_TEST_JAVA/org/springframework/forum/domain
Created SRC_TEST_JAVA/org/springframework/forum/domain/PizzaOrderDataOnDemand.java
Created SRC_TEST_JAVA/org/springframework/forum/domain/PizzaOrderIntegrationTest.java
Created SRC_MAIN_JAVA/org/springframework/forum/domain/PizzaOrder_Roo_Entity.aj
Created SRC_MAIN_JAVA/org/springframework/forum/domain/PizzaOrder_Roo_ToString.aj
Created SRC_MAIN_JAVA/org/springframework/forum/domain/PizzaOrder_Roo_Configurable.aj
Created SRC_TEST_JAVA/org/springframework/forum/domain/PizzaOrderIntegrationTest_Roo_Configurable.aj
Created SRC_TEST_JAVA/org/springframework/forum/domain/PizzaOrderDataOnDemand_Roo_DataOnDemand.aj
Created SRC_TEST_JAVA/org/springframework/forum/domain/PizzaOrderIntegrationTest_Roo_IntegrationTest.aj
Created SRC_TEST_JAVA/org/springframework/forum/domain/PizzaOrderDataOnDemand_Roo_Configurable.aj
~.domain.PizzaOrder roo> field string --fieldName name --notNull --sizeMin 2
Managed SRC_MAIN_JAVA/org/springframework/forum/domain/PizzaOrder.java
Created SRC_MAIN_JAVA/org/springframework/forum/domain/PizzaOrder_Roo_JavaBean.aj
Managed SRC_TEST_JAVA/org/springframework/forum/domain/PizzaOrderDataOnDemand_Roo_DataOnDemand.aj
Managed SRC_MAIN_JAVA/org/springframework/forum/domain/PizzaOrder_Roo_ToString.aj
~.domain.PizzaOrder roo> field string --fieldName address --notNull --sizeMax 30
Managed SRC_MAIN_JAVA/org/springframework/forum/domain/PizzaOrder.java
Managed SRC_MAIN_JAVA/org/springframework/forum/domain/PizzaOrder_Roo_JavaBean.aj
Managed SRC_MAIN_JAVA/org/springframework/forum/domain/PizzaOrder_Roo_ToString.aj
Managed SRC_TEST_JAVA/org/springframework/forum/domain/PizzaOrderDataOnDemand_Roo_DataOnDemand.aj
~.domain.PizzaOrder roo> field number --fieldName total --type java.lang.Float
Managed SRC_MAIN_JAVA/org/springframework/forum/domain/PizzaOrder.java
Managed SRC_MAIN_JAVA/org/springframework/forum/domain/PizzaOrder_Roo_JavaBean.aj
Managed SRC_MAIN_JAVA/org/springframework/forum/domain/PizzaOrder_Roo_ToString.aj
Managed SRC_TEST_JAVA/org/springframework/forum/domain/PizzaOrderDataOnDemand_Roo_DataOnDemand.aj
~.domain.PizzaOrder roo> q