In Grails, how do I declare a SQL Server Schema name for a Domain Class?

grails, grails-orm

Solution

You can do this when you explicitly specify the mapping in a domain class as described here:

class Book {
    static mapping = {
        table name:"books", schema:"dbo"
    }
}

Problem

I have recently started reading up on Grails and would like to use SQL Server security schemas to group tables generated by GORM. However, I cannot seem to find a reference explaining how to perform this task. I am new to Hibernate as well and would like to know if this is possible. Thank you.

Original source