Last updated by burtbeckwith
7 months ago
Grails 1.1 Beta 1 Release Notes
28th of November 2008SpringSource and the Grails development team are pleased to announce the 1.1 Beta 1 release of the Grails web application development framework.This is the first milestone on the way to the final Grails 1.1 release and includes a number of new features that are detailed in the "New Features" section.Further information about the release can be obtained using the links below:- Changelog: http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10020&version=11008
- Download: http://grails.org/Download
- Documentation: http://grails.org/doc/1.1
New Features
GORM
Better GORM events
Previously, GORM supported beforeInsert, beforeUpdate and beforeDelete events, now there is afterInsert, afterUpdate and afterDelete to complete the picturePersistence of Collections of Basic Types
GORM now supports persisting basic types like String, Integer and so on using a join table:class Person {
static hasMany = [nicknames:String]
}Improvements to Data Binding
It is now simpler to bind data to a subset of properties. Previously you could use the syntax:person.properties = params
person.properties["firstName","lastName"] = params
person.properties["firstName","lastName"].each { println it }
Read-Only Access to Objects
Persistent instances can now be loaded in a read-only state using the read method:def book = Book.read(1)
Default Sort Order
Associations can now be sorted using a default sort order declared at the class level:class Book {
String title
static mapping = {
sort "title"
}
}class Author {
static hasMany = [books:Book]
static mapping = {
books sort:"title"
}
}Batch Fetching
GORM now supports configuring batch fetching (an optimization of lazy loading) using the ORM DSL at the class level:class Book {
String title
static mapping = {
batchSize 15
}
}class Author {
static hasMany = [books:Book]
static mapping = {
books batchSize:15
}
}Improvements to Dynamic Finders
There is a new InList suffix that can be used with dynamic finders:def groovyBooks = Book.findByAuthorInList(['Dierk Koenig', 'Graeme Rocher'])
def books = Book.findByTitle("Groovy in Action", [cache:true] )
def books = Book.findByTitle("Groovy in Action", [lock:true] )
Legacy Mapping for Unidirectional One-to-manys
Unidirectional One-to-many associations can use the joinTable argument to alter the way they map to the underlying database:class Book {
String title
static belongsTo = Author
static hasMany = [authors:Author] static mapping = {
authors joinTable:[name:"mm_author_books", key:'mm_book_id' ]
}
}
class Author {
String name
static hasMany = [books:Book]
static mapping = {
books joinTable:[name:"mm_author_books", key:'mm_author_id']
}
}Plugins
Global Plugins
Plugins can now be installed globally for all applications:grails install-plugin webtest -global
Multiple Plugin Repositories
Grails now supports the ability to configure multiple plugin repositories by providing a USER_HOMER/.grails/settings.groovy file or a grails-app/conf/BuildSettings.groovy file that contains the configured repository details:grails.plugin.repos.discovery.myRepository="http://svn.codehaus.org/grails/trunk/grails-test-plugin-repo" grails.plugin.repos.distribution.myRepository="https://svn.codehaus.org/grails/trunk/grails-test-plugin-repo"
Automatic Transitive Plugin Resolution
Plugins no longer need to be checked into SVN and will automatically be installed via a plugins metadata when the application is first loaded.In addition, plugin dependencies are now resolved transitively.Testing
The Test Framework
The new test framework, available as a plugin for the 1.0.x series, is integrated in Grails 1.1Scaffolding
Templates and Dynamic Scaffolding
Dynamic scaffolding now uses the templates that can be installed via the install-templates command.
Upgrade notes
Grails 1.1 has a number of changes, but should be mostly backwards compatible with 1.0.x series applications. If you have issues please report them. The following is a list of known issues that need to be considered when upgrading- Plugins are not stored in your USER_HOME directory. You will need to re-install your plugins or run:
grails -Dgrails.plugins.dir=./plugins run-app
- Enums are now mapped onto the database with String values instead of ordinals by default
- jsession id is now disabled by default. See GRAILS-3364
- GSP whitespace handling has been changed for the better, you may have more whitespace than before. See GRAILS-3277
- The The grails.testing.reports.destDir config option has been replaced by grails.project.test.reports.dir
- PreInit.groovy is now BuildSettings.groovy