If you have used Roo for a few minutes only (as it tends to encourage you, to due to its simplicity), you have probably used the HYPERSONIC_IN_MEMORY database configuration. This is good for a first prototype, however once you start adding data, you want to start using HYPERSONIC_PERSISTENT or simply another available database as described with the --database parameters. Roo makes this change a very pleasant experience. I chose MYSQL (since it was already installed). What a pleasant surprised that all I had to do was to write the following:
persistence setup --provider HIBERNATE --database MYSQL --userName --password --databaseName
At this point, all appropriate files were updated. Since I was using git for version control, I was able to see the files updated. Not only was the pom.xml updated, but also the database.properties touched with the new configuration for the jdbc connection. I also noticed that the persistence.xml file was changed from "update" to "create" (I have to change this back to "update" if I want to continue seeing my data after reloads). This was nice as it makes sense to create the schema when it doesn't exist. I opened DbVisualizer and was happily browsing my newly created tables without problems.
In a few words: Bravo Roo!
No comments:
Post a Comment