Joined: Sun Apr 15, 2007 12:14 pm Posts: 2
|
Hi,
I m new to Hibernate .... need some help regarding QBE. I m having a class A containing type class B and class C. In databse table A is having one-to-one relationship with B and C. I am trying to retrieve the list in the following manner....
Example example = Example.create(a).ignoreCase().excludeProperty(
"isPlateMovable").excludeProperty("isMotorvehContactAddressUsed")
.excludeProperty("isEvnReceiverAddressUsed").excludeProperty(
"isPlateReceiverAddressUsed").excludeProperty("targetShipping");
return (Evn) session.createCriteria(A.class).add(example).createCriteria(
"b").add(
Example.create(a.getB()).excludeProperty(
"passengerTransportation").excludeProperty("hiredVehicle")
.excludeProperty("dangerousGoods").excludeProperty(
"replacementVehicle"))).createCriteria(
"c").add(
Example.create(a.getC()).excludeProperty(
"passengerTransportation").excludeProperty("hiredVehicle")
.excludeProperty("dangerousGoods").excludeProperty(
"replacementVehicle"))..list().iterator().next();
The problem is the B is getting associated with A and C is associated with B. It is throwing some exception saying Class B does not contain c.
Please let me know how can I associate B and C with A.
Thanks.
|
|