How to query a collection of inherited object for a particular object type in grails ?

Posted by quilovnic on Stack Overflow See other posts from Stack Overflow or by quilovnic
Published on 2010-05-25T10:28:44Z Indexed on 2010/05/25 10:31 UTC
Read the original article Hit count: 158

Filed under:
|

Hi, I have a this model :

class Question{
  Set components
  static hasMany = [components: QuestionComponent]
}

class QuestionComponent{
  static belongsTo = Question
}

class QuestionComponentStatus extends QuestionComponent{

}
class QuestionComponentOther extends QuestionComponent{

}

I want to get only QuestionComponentStatus from Set components :

questionInstance.components. ?

Thanks a lot

© Stack Overflow or respective owner

Related posts about java

Related posts about grails