-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Search using QBE
PostPosted: Sun Apr 15, 2007 1:16 pm 
Newbie

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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 25, 2007 7:14 am 
Newbie

Joined: Wed Apr 25, 2007 5:46 am
Posts: 7
Hi,

Did you solve the problem with respect to associations. I am facing the same problem now in my search process. I have Company associated with CompanyAddress. How did you solve your issue?


With thanks,
Amutha


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.