Call GORM's .list() in trait with generic type
In my Grails 6 project, I'd like to add an additional feature to select domain classes, so I defined a custom trait.
trait MyDomainClassTrait implements GormEntity {}
// domain class
class Page implements MyDomainClassTrait {
String id
}
What I'm trying to achieve is to define some sort of "cache manager", internal to the trait, mimicking a few GORM-like methods, so to be able to use either:
Page.list(), native GORM
Page.cache.list(), returns all GORM entities previously stored in...