gorm « Search « JPA Q&A





1. How to get search results in grails if you have the domain (model) name stored in a string    stackoverflow.com

I have a method which has domain name as a String parameter.

def modelName="Equity"
I want to use it like
def results=modelName.findAll()
Please guide me!

2. Question of grails findAllBy when search for for foreign key    stackoverflow.com

class File {
   String name
   File parent;    
   static belongsTo =[parent:File ]   
   static hasMany = [childrens:File];  ...