how can I get a list of alle domain classes I use in my project? Something like GORM.domains.list()
.
Asked
Active
Viewed 6,997 times
13

Jan
- 1,445
- 1
- 16
- 20
1 Answers
27
Using
grailsApplication.getArtefacts("Domain")
you get a list of GrailsDomainClass instances that hold meta-information regarding the domain class. The domain class itself is returned by Calling getClazz(). In short:
grailsApplication.getArtefacts("Domain")*.clazz
returns a complete list of the existing domain classes.

Stefan Armbruster
- 39,465
- 6
- 87
- 97
-
11Newer grails versions also support grailsApplication.domainClasses as well as getArtefacts. – Rob Elsner Mar 14 '11 at 18:33