I have 2 classes:
class A {
B b;
public A() {}
public A(B b) { setB(b); }
...
}
class B {
int id;
public B(int id) { setId(id); }
}
in hql I want to select like this:
select new A( new B(a.b.id) ) from A a
but I got error
org.hibernate.hql.PARSER - line 1:48: unexpected token: ,
Is it possible to create object in parameter, or select just field and create it inside constructor?
newhere, can't you just doSELECT a ...?