Grails search from one to many is not working -


here domain class,

class company {     string name     static hasmany = [groups:companygroup] }  class companygroup{     string name     static belongsto = [company:company] } 

i receive params contain name of companygroup , want result of company have companygroup found.

i did this,

def grouplist = account.companies.groups.flatten() def groupresult = grouplist.findall{     it.name ==~  /(?i).*${params.keyword}.*/  } 

i got companygroups have name params.key above code. want render company list have these group this,

def com = company.withcriteria{   eq("groups", grouplist) } render [companies : com]   

it doesn't work!

def com = company.withcriteria{   inlist("groups", grouplist) } 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -