views:

24

answers:

1

Hi, I have this code :

class A {
  String name
}
class B extends A{

} 
class C extends A{

}
class D{
  A a
}
D d = new D(); d.a = new B()
D d2 = new D(); d.a = new C()

My query :

D.createCriteria().list(...){
  A{
    eq "a","test" 
  }
}

But in my result I would have only the element matching with B class not C class.

Is it possible ?

Thanks a lot

+1  A: 

I find this :

A{
  eq "class", B.name
}

Thank you