O'Reilly logo

Grails 2: A Quick-Start Guide by Ben Klein, Dave Klein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Bootstrapping Some Test Data

To get a better feel for how TekDays is coming along, we can enter some data and check out the various views. We’ve seen the list and create views, but there’s also the show and edit views.

The problem with entering test data now is that it would all be lost as soon as we restarted the application. We’re working with an in-memory database at this point. Eventually, we will point TekDays at a real database, but for now, the in-memory H2 database is pretty handy—that is, it would be if we didn’t lose our data.

This dilemma’s answer is in TekDays/grails-app/conf/BootStrap.groovy. The file has an init code block, which is executed by our application at start-up. If we create TekEvent instances there, they will be ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required