Hi
Im sorry, but i really got no clue how to resolve my problem.
(Pseudocode)
class A {
List<B> bs;
}
now i query 2 entities of b:
B b1 = myquery("constraints ... ")
B b2 = myquery("constraints ... ")
My question now is: How to find the entity of A, where a.bs contains b1 and b2 and nothing else.
My best idea till yet:
// pseudocode - just out of my mind
"where :b1 in elements (a.bs) and :b1. in elements(a.bs) and a.bs.size = 2"
I seen the "all elements" syntax inside the hib doku. No explanation, but its mentioned 2 times ;o)
So i thought it could be something like:
List example = new ArrayList();
example.add(b1).add(b2)
and now query like
":example = all elements(a.bs)"
setEntity("example",example);
Im not even sure if something like that could be possibible to work. It simply fails because hib does not know how to handle the ArrayList.
Would be fine, when youe could help me little bit ;o)
thx
Bernhard Neuhauser
Hibernate version: 3.0.5
Database: PostgreSQL 8.0
|