Hi,
I noticed that using Criteria API I received always too many columns in final Select.
e.g.:
Code:
Class A {
int id;
String name;
List bs;
...
}
Class B {
int id;
String name;
A a;
...
}
code snippet:
Code:
...
Criteria criteria = session.createCriteria(A.class).createCriteria("bs")
.add(Property.forName("name").eq("example"));
List A = session.list();
...
Select looks like this:
Code:
select this_.id as id0_1_,
this_.name as name0_1_,
this_.b_id as b5_0_1_,
b1_.id as id2_0_,
b1_.name as name2_0_
from A this_
inner join B b1_ on this_.b_id = b1_.id
where b1_.id = ?
I'd like to ask you if there is method to limit columns amount in final select to ones from entity A?
I found discusion about this issue, but there are only some workarounds:
http://forum.hibernate.org/viewtopic.ph ... torder=asc
Slawek