0

I have three class.

class User {
    String userFirstName    
    String userLastName
}

class Group {
    List<User> userList
    String groupName     
    static hasMany = [userList: User]
}

class work {
    User worker
    Group group    
}

Now, I want to show List of works where work's group is equal to user's group. and User can be in multiple group also.

and I also need all unique users who are in my groups.

Arturo Herrero
  • 12,772
  • 11
  • 42
  • 73
sanghavi7
  • 758
  • 1
  • 15
  • 38
  • :this question is written in a way that make me think that you're hoping others write code for you. Did you try anything before asking here? – Hoàng Long Jun 14 '12 at 09:43
  • no no @hang Long, you get me wrong. I am not able to right HQL query for that, that`s y I asking it dude.. – sanghavi7 Jun 14 '12 at 10:15
  • well, if that's the case, then it's ok. Please show your work (the hql you are writing, for example), point out the part that doesn't work and why you think it should work. Others will help you correct it. – Hoàng Long Jun 14 '12 at 10:20
  • Btw, in this question, you have several possible solutions for your problem: dynamic queries, hql, criteria... I would like to recommend reading the Grails document for those things. If you are not familiar with programming, just say it in the question. Others will be more sympathized – Hoàng Long Jun 14 '12 at 10:22

0 Answers0