Last updated by
3 years ago
Page: 1.3 Release Notes, Version:2
Grails 1.3 Release Notes
SpringSource - a division of VMware are pleased to announce the 1.3 release of the Grails web application development framework.Grails is a dynamic web application framework built on Java and Groovy, leveraging best of breed APIs from the Java EE sphere including Spring, Hibernate and SiteMesh. Grails brings to Java and Groovy developers the joys of convention-based rapid development while allowing them to leverage their existing knowledge and capitalize on the proven and performant APIs Java developers have been using for years.Further information about the release can be obtained using the links below:- Changelog: See JIRA
- Download: http://grails.org/Download .
- Documentation: http://grails.org/doc/1.3.x
Groovy 1.7 Support
Grails 1.3 comes with the recently released 1.7 version of the Groovy language, which includes loads of new features like anonymous and nested class support, power asserts and more. See the Groovy 1.7 release notes for info.JUnit 4
Grails 1.3 now uses JUnit 4 to run tests. JUnit 4 features a richer assertion API and many features like timeouts, ignores, class level before and after methods, hamcrest matchers, assumptions, theories and more.Pre Grails 1.3 tests are fully backwards compatible.Improvements to Modular Plugin Development
There are a couple of significant improvements to modular application development with plugins:- You can now override any plugin provides class, view or template simply by creating an equivalent class (same package/class name) or GSP in your application
- You now no longer need to run package-plugin in each inline plugin prior to using or building a WAR file
Maven Repository Support
Grails now has full support for publishing plugins to (using the maven publisher plugin) and reading plugins from Maven compatible repositories.You can easily configure additional plugin repositories in BuildConfig.groovy using the Ivy DSL introduced in Grails 1.2:repositories {
mavenRepo "http://repository.codehaus.org"
}grailsCentral method:repositories {
grailsCentral()
}Declarative Plugin Dependencies
Alongside the new Maven repository support you can now declare plugin dependencies using the Ivy DSL:plugins {
runtime ':hibernate:1.2.1'
}plugins {
runtime( ':weceem:0.8' ) {
excludes "searchable"
}
}plugins {
build( ':weceem:0.8' )
}Dirty Checking in GORM
GORM includes new methods to check whether an object has been modified:def airport = Airport.get(10) assert !airport.isDirty()airport.properties = params if (airport.isDirty()) { // do something based on changed state }
def airport = Airport.get(10) assert !airport.isDirty()airport.properties = params if (airport.isDirty('name')) { // do something based on changed name }
GORM Support For Derived Properties
GORM now provides a mechanism for taking advantage of Hibernate's derived properties support.class Product {
Float price
Float finalPrice static mapping = {
finalPrice formula: 'PRICE * 1.155'
}
}Named Queries Support Additional Criteria
Additional criteria may be supplied to named queries at invocation time:class Publication {
String title
String author
Date datePublished
Integer numberOfPages static namedQueries = {
recentPublications {
def now = new Date()
gt 'datePublished', now - 365
}
}
}def books = Publication.recentPublications {
or {
like 'author', 'Tony%'
like 'author', 'Phil%'
}
}Chaining Named Criteria
Named criteria may be chained together. When criteria are chained together, the query will be generated as if all of the chained criteria had been combined in a single criteria closure.// recent publications with 'Book' in the title def books = Publication.recentPublications.publicationsWithBookInTitle.list() // old publications with more than 500 pages and with 'Book' in the title def books = Publication.oldPublicationsLargerThan(500).publicationsWithBookInTitle.list()
Global application layouts
You can now define a layout to be used by all pages that don't specifiy one otherwise by creating agrails-app/views/layouts/application.gsp file. The name of the layout to use can also be modified in Config.groovy:grails.sitemesh.default.layout='myLayoutName'New GSP Tag - join
<g:join in="['Grails', 'Groovy', 'Gradle']" delimiter="_"/>
Grails_Groovy_Gradle
PDF Publishing for Grails doc
The 'grails doc' command can now produce a PDF document from your user documentation sources:grails doc --pdf
grails doc --init