In Grails / GORM, what is the difference between static mapping = {xyz lazy: false}
& static fetchMode = [xyz: 'eager']
?
Example:
class Book {
static belongsTo = [author: Author]
static mapping = {author lazy: false}
static fetchMode = [author: 'eager']
}
The difference between lazy:false and fetchMode 'eager' are
Should you be interested in a detailed explanation about Fetchmodes, take a look http://www.solidsyntax.be/2013/10/17/fetching-collections-hibernate/. The article describes the Hibernate fetchmodes and the output which they produce.
Hope this helps.