Hi everyone,
I need some help doing a query...
Let's assume:
Code:
class A{
String attributeA1;
String attributeA2;
}
class B{
String attributeB;
A a;
}
......
Code:
B exampleB = new B();
A exampleA = new A();
exampleA.attributeA1 = "attributeA1";
exampleA.attributeA2 = "attributeA2";
exampleB .setA( exampleA );
......
I am trying to run the following query:
Code:
Example example = Example.create( B );
example.enableLike(MatchMode.ANYWHERE);
Criteria criteria = session.createCriteria( B.getClass() );
criteria.add( example );
List l = criteria.add(example).list();
It doesn't work...search ignores the attributes set in A. It works only for the attribute inside class B.
I'm doing something wrong????
Thanks