Announcement Announcement Module
Collapse
No announcement yet.
Deleting entities while adding Float type Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Deleting entities while adding Float type

    I am working on the tutorial from Roo and whenever I add this Float type to the PizzaOrder class the associated Aspects are deleted. I tried this 2 times with the same result. What am i doing wrong?
    I am on Windows with Roo 1.0.0 Release [rev 546]

    roo> entity --class ~.domain.PizzaOrder --testAutomatically
    Created SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder.java
    Created SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder_Roo_Entity.aj
    Created SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder_Roo_ToString.aj
    Created SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder_Roo_Configurable
    ~.domain.PizzaOrder roo> field string --fieldName name --notNull --sizeMin 2
    Managed SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder.java
    Created SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder_Roo_JavaBean.aj
    Managed SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder_Roo_ToString.aj
    ~.domain.PizzaOrder roo> field string --fieldName address --notNull --sizeMax 30
    Managed SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder.java
    Managed SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder_Roo_JavaBean.aj
    Managed SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder_Roo_ToString.aj
    ~.domain.PizzaOrder roo> field number --fieldName total --type java.long.Float
    Managed SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder.java
    Deleted SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder_Roo_Entity.aj
    Deleted SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder_Roo_Configurable
    Deleted SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder_Roo_JavaBean.aj
    Deleted SRC_MAIN_JAVA\com\springsource\roo\pizzashop\domai n\PizzaOrder_Roo_ToString.aj

    Thanks in advance,
    Raj

  • #2
    Originally posted by rvauradkar View Post
    ~.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

    Comment


    • #3
      Thanks.
      Thats embarassing. A typo :-)

      Comment

      Working...
      X