Search Results

Search found 3 results on 1 pages for 'user303979'.

Page 1/1 | 1 

  • Compare associations between domain objects in Grails

    - by user303979
    I am not sure if I am going about this the best way, but I will try to explain what I am trying to do. I have the following domain classes class User { static hasMany = [goals: Goal] } So each User has a list of Goal objects. I want to be able to take an instance of User and return 5 Users with the highest number of matching Goal objects (with the instance) in their goals list. Can someone kindly explain how I might go about doing this?

    Read the article

  • Multiple dynamic method calls or declaring a variable in Grails

    - by user303979
    In my view, if I have a situation where I need to use a dynamic method (such as Domain.findByName("name")) in multiple places, would it be better to define a variable with and refer to that, rather than have the dynamic method in multiple places? I know this seems like an obvious answer, but I just wanted to make sure Grails doesn't cache it or something, and indeed two DB calls are being made.

    Read the article

1