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
Post a Comment