Search code examples
springconsolespring-roo

How to re-open an existing SpringRoo project?


Perhaps a stupid newbie question: How to re-open an existing roo project and add new fields or entities without erasing existing data, e.g.:

roo.sh
  project  --topLevelPackage de.test.model
  jpa setup  --provider HIBERNATE  --database MYSQL 
  entity jpa  --class de.test.model.Person
  field string  --fieldName name
quit

roo.sh
  field string  --fieldName surname

Solution

  • Nothing to worry, looking at the commands you have issued it will not erase your existing data. You will need to execute the focus command in order to make sure the Roo console is currently focused on the entity you are adding fields to.

    roo> focus --class com.foo.Blah
    ~.Blah roo>
    

    You can find out the history of this command at https://jira.springsource.org/browse/ROO-784.

    Cheers.