Grails Persistence with GORM and GSQL and over 2 million other books are available for Amazon Kindle . Learn more

Sign in to turn on 1-Click ordering.
More Buying Choices
Have one to sell? Sell yours here
Sorry, this item is not available in
Image not available for
Image not available

Start reading Grails Persistence with GORM and GSQL on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Grails Persistence with GORM and GSQL [Paperback]

Robert Fischer
3.5 out of 5 stars  See all reviews (2 customer reviews)
RRP: 23.99
Price: 17.42 & FREE Delivery in the UK. Details
You Save: 6.57 (27%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In stock.
Dispatched from and sold by Amazon. Gift-wrap available.
Want it Wednesday, 23 April? Choose Express delivery at checkout. Details


Amazon Price New from Used from
Kindle Edition 13.17  
Paperback 17.42 Trade-In Store
Did you know you can use your mobile to trade in your unwanted books for an Gift Card to spend on the things you want? Visit the Books Trade-In Store for more details or check out the Trade-In Amazon Mobile App Guidelines on how to trade in using a smartphone. Learn more.

Book Description

1 May 2009

Unique to the popular Grails web framework is its architecture. While other frameworks are built from the ground up, Grails leverages existing and proven technologies that already have advanced functionality built in. One of the key technologies in this architecture is Hibernate, on top of which Grails builds its GORM (Grails Object Relational Mapping) model layer. This provides Grails a persistence solution.

Published with the developer in mind, firstPress technical briefs explore emerging technologies that have the potential to be critical for tomorrow’s industry. Apress keeps developers one step ahead by presenting key information as early as possible in a PDF of 150 pages or less. Explore the future through Apress with Grails Persistence with GORM and GSQL.

This firstPress book covers Grails persistence with GORM, from defining your first model to the nature of transactions and advanced Hibernate querying. Other APIs and tools such as GSQL (Groovy SQL) are covered as well, as needed, to empower your Grails persistence efforts.

What you’ll learn

  • Extend the Grails web framework into a broader, semi–enterprise framework by including and integrating Hibernate–based Java persistence, known as GORM.
  • Use mappings to customize default behaviors and work with legacy schemas.
  • Use constraints to define your object once and have those constraints enforced both in code and at the database level.
  • Use advanced features of GORM and Hibernate Query Language (HQL) to simplify database querying and report generation.
  • Debug and tune trips for GORM and Hibernate.
  • Fill in the gaps with GSQL.

Who this book is for

This title is for those who have committed to dedicating some time to mastering Grails and are looking to move beyond the basics, and are especially interested in Grails and Groovy persistence for some limited transaction handling and/or accessing databases.

Table of Contents

  1. Defining the Model in GORM
  2. Customizing GORM Mapping and Enforcing Data Integrity
  3. Querying with GORM and HQL
  4. GORM Usage in Grails
  5. Filling in the Gaps with Groovy SQL and Spring’s JDBC Support

Customers Who Bought This Item Also Bought

Product details

  • Paperback: 148 pages
  • Publisher: firstPress (1 May 2009)
  • Language: English
  • ISBN-10: 1430219262
  • ISBN-13: 978-1430219262
  • Product Dimensions: 23.5 x 19 x 0.8 cm
  • Average Customer Review: 3.5 out of 5 stars  See all reviews (2 customer reviews)
  • Amazon Bestsellers Rank: 1,775,663 in Books (See Top 100 in Books)

Product Description

About the Author

Robert Fischer is an independent contractor specializing in web application development and technical leadership. He is a regular presenter at conferences on the topic of Groovy and Grails, development best practices, and functional programming. He also is a regular contributor to open source in many languages, with his key contributions being the JConch library for Java concurrency, a plugin for Grails for background thread processing, and a plugin for Grails for automatic database updating. He resides in Durham, North Carolina, with his wife.

Inside This Book (Learn More)
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Back Cover
Search inside this book:

Customer Reviews

5 star
2 star
1 star
3.5 out of 5 stars
3.5 out of 5 stars
Most Helpful Customer Reviews
1 of 1 people found the following review helpful
3.0 out of 5 stars A mixed bag 10 Jan 2010
This book has some some five star content in places.
I've picked up a few new Groovy tricks to add to my coding repertoire and I'd recommend this book for that alone.
The book demonstrated things with extensive use of Assert statements which was good.

But there are a few things that irked me and hence the loss of a couple of stars (points 5-7 lose a star and points 8 & 9 causes loss of a second).
1) Comments showing artifact names weren't in some other font or bold or in italics to show a clear deliniation between artifacts in an individual listing.
2) P25 Luke Daley's Injecto library. The link seems to have stopped working at the time I write this.
I looked on the Wayback machine and found it was also used in GLDAPO. Then I exchanged Tweets with Luke & he tells me the @mixin annotation have replaced this.
Guiilliame LaForge covers @mixin this in the Groovymag April 2009 issue (What's new in Groovy 1.6) and Craig Wickesser gave an example in Dec 2009 issue (Groovy MetaObject Programming).
3) P27 1-30 should be 1-32
4) P130.
- Firstly, it seems there are a couple of lines missing here to declare the Testing class and a comment to signify where the artifact is along with its name.
- Secondly the author quotes parameter mapping for Dates as not working in Grails Controllers. So statements like:
def foo = new Foo(params)
def foo = new Foo() = params
wouldn't work for Dates.

I investigated this a bit more and I think this was as a result of the test the author was performing not a Grails problem per se!
ie Date.toString() doesn't give a date in a format that the underlying Spring binding understands!
Read more ›
Comment | 
Was this review helpful to you?
4.0 out of 5 stars Just what I needed 4 Sep 2012
Format:Paperback|Verified Purchase
I found this book via a link in a blog. I was able to download it straight away using the magic of Kindle and, while I appreciate this Amazon magic rather than book magic, it did make me approach the book with a positive mood).

I read the whole thing over a weekend. This is unheard for for me - there's normally something I find too dry that I start hopping around and subsequently only really "use" a fraction of a book - nothing wrong in that of course.

For me this book was ideal. I've been using Grails for a while on a personal project but was aware I didn't know how to do much beyond using the "findBy*" methods. I've used Hibernate before but find that a bit abstract at times.

The book introduced the various ways of getting "stuff" from the DB - from GORM to SQL and it gave a quick overview of the caches and how to use Grails cache directives. These tips alone justified getting the book for me.

Chris Ward
If I want more detail I now at least know what to go and look for.

I liked it. For me it did exactly what it said on the tin.
Comment | 
Was this review helpful to you?
Most Helpful Customer Reviews on (beta) 3.5 out of 5 stars  14 reviews
5 of 5 people found the following review helpful
4.0 out of 5 stars Guys. It's a FirstPress intro book. Seriously. 3 July 2009
By John Stoneham - Published on
The other reviewers are complaining there's not much here. I admit I picked it up in eBook format hoping to get a detailed, deep dive into the very bowels of Grails persistence. This isn't that book.

What I did find is that it's ideal for someone new to Grails, to understand all of the options available to you for persistence-level work. Everything from the basics of domain classes through Hibernate-land all the way down to raw SQL. It's a short survey work - which I should have expected given that it's by FirstPress. Give it to the new Grails developers on your project - this is stuff they NEED to know and they can read it in a couple of hours.

I got a second copy for our DBA. This is her first foray above the database level into helping with the application programming level. It's helping her understand where we developers are coming from, and to give us better advice.

Recommended as a starter work to understand your options. But to go deeper into Grails or Hibernate, you'll want an additional book. I recommend Grails in Action and Java Persistence with Hibernate.
4 of 4 people found the following review helpful
3.0 out of 5 stars Good reference for Grails persistence 6 May 2009
By Trevor Burnham - Published on
Format:Paperback|Verified Purchase
This is a good, quick guide to persistence in Grails. It follows a good pattern: Here's some short code, here's an explanation, and here's an integration test to cover the details. At times, this style is too quick, sketching over details and leaving me without a complete understanding.

The book doesn't talk about setting up your Grails environment. It's clearly aimed at people who already know how to use Grails but want a more thorough understanding of how to use their domain objects. All of this information is online, of course, but as the author points out a couple of times, the official documentation has always contained some inaccuracies. So this book is a good supplement. Is it a good read? Not really. It doesn't use an example project. It doesn't tell you how to built a better database. It assumes you know what you want to do and tells you how to do it. I mean that in the best possible way: Despite the popularity of Grails, info on best practices remains hard to find, and the source code in this book is very sleek, well-tested and Grails-y.

Whereas every Grails developer absolutely must have The Definitive Guide to Grails, Second Edition, which covers GORM pretty well, this book is good for reference. Not, however, in its slim, oversized-text print edition, which, as a FirstPress book, doesn't even have an index. I'd recommend it as an eBook only.
3 of 3 people found the following review helpful
4.0 out of 5 stars Handy Reference for GORM 7 May 2009
By G. Dickens - Published on
Format:Paperback|Verified Purchase
At first I was surprised that it was a total of 156 pages (I was pleased that I didn't have to work my way through yet another 700 page book).

As the title indicates this is focused on one of the greatest assets of Grails, GORM. When working with GORM, you really need examples and options to help you with common data query and dataset organization tasks, this book provides that.

In a nutshell, if you are working on a Grails project, this book will provide you with a concise reference with great code examples of valuable GORM features that you will refer back to.
4 of 5 people found the following review helpful
4.0 out of 5 stars Comments from the Author 26 Jun 2009
By Robert Fischer - Published on
This book was intended for the beginner-to-immediate developer, and so those who are already pros may find it a bit simplistic (although I'm not sure). It was also intended to be a lot more accessible than the more thorough and in-depth "Definitive Guide to Grails" or "Grails in Action": it was supposed to be a bit of a handbook instead of a deep dive.

The emphasis of this book was on demonstrating clear and provably-correct code around GORM: I wanted to write a test-driven book so that if you encountered problems in your code, you could figure out how to test them. I also wanted to show that I was not only asserting how things *should* work, but really demonstrating how things *do* work.

Once these basics were covered, I proceeded to go into some tips and tricks I knew. Although much of the first third of the book is either demonstrations of or corrections to information available through Grails online resources, the last two thirds of the book comes directly from my conversations and problem solving as part of the Grails-User mailing list and as an independent Grails consultant. Although some of the tips and tricks might be obvious to an established Grails professional who has been keeping up with Grails-User for the last couple of years, many of the stunts I outline were surprises or tricky to get right for me when I first encountered them. Because of that, I wanted to share these stunts more widely.

If you'd like to see an expanded and updated version with more details, I'd encourage you to contact APress and let them know. The FirstPress nature of the book was extremely constraining -- I pushed right up against the 150 page limit of the FirstPress format, and while I tried to cram as much meet as I could into 150 pages, there's naturally stuff that was going to be left out. I'd be very interested in doing an expanded and updated version of the book for Grails 1.2 (whenever that finally comes out).
2 of 3 people found the following review helpful
1.0 out of 5 stars Felt like reading Dr Seuss. 28 May 2009
By Cedric Dandoy - Published on
I am twice disappointed:

First, the content of the book did not teach me anything that I had not already read in the "The Definitive Guide to Grails" or online articles.

The second disappointment is the "firstPress" format. The book is ridiculously short: 156 pages but the font is so large that you only have about 30 lines per page.
Since about half of the book is code listing, you don't really get much meat.

In conclusion, I would recommend the "Definitive Guide to Grails" instead of this book.
Were these reviews helpful?   Let us know
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
First post:
Prompts for sign-in

Search Customer Discussions
Search all Amazon discussions

Look for similar items by category