Skip to content

Commit

Permalink
Workaround for grails/gorm-hibernate5#750 (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbwexler authored Oct 31, 2023
1 parent 5c2825c commit 0df30a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 18.0-SNAPSHOT - unreleased

### 🐞 Bugfixes

* Workaround for GORM issue with unconstrained findAll() and list() breaking eager fetching.
See https://github.com/grails/gorm-hibernate5/issues/750


## 17.3.0 - 2023-09-18

### ⚙️ Technical
Expand Down
10 changes: 9 additions & 1 deletion src/main/groovy/io/xh/hoist/HoistCoreGrailsPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ class HoistCoreGrailsPlugin extends Plugin {
}
}

void doWithDynamicMethods() {}
void doWithDynamicMethods() {
// Workaround for issue with unconstrained findAll() and list().
// See https://github.com/grails/gorm-hibernate5/issues/750
grailsApplication.domainClasses.each {
def meta = it.metaClass.static
meta.list = meta.findAll = { delegate.findAll({}) }
meta.list = meta.findAll = { Map params -> delegate.findAll(params, {}) }
}
}

void doWithApplicationContext() {}

Expand Down

0 comments on commit 0df30a6

Please sign in to comment.