-->
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.  [ 7 posts ] 
Author Message
 Post subject: How do you use more than 1 child association with Example?
PostPosted: Thu Jun 02, 2005 6:05 pm 
Newbie

Joined: Thu Jun 02, 2005 5:53 pm
Posts: 4
http://www.hibernate.org/hib_docs/api/n ... ample.html

The code from the above link works with one child:
Code:
List results = session.createCriteria(Parent.class)
     .add( Example.create(parent).ignoreCase() )
     .createCriteria("child")
         .add( Example.create( parent.getChild() ) )
     .list();



But what about two children of the parent class?

Code:
List results = session.createCriteria(Parent.class)
     .add( Example.create(parent).ignoreCase() )
     .createCriteria("child1")
         .add( Example.create( parent.getChild1() ) )
             .createCriteria("child2")
                 .add( Example.create( parent.getChild2() ) )
     .list();


This will look for child2 being a child of child 1 which is incorrect. How can I use Example with 2 children associations?

Thanks for any help.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 12:30 pm 
Newbie

Joined: Thu Jun 02, 2005 5:53 pm
Posts: 4
I take the lack of replies as a sign that this is not possible.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 12:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Of course it is possible.

I'm quite sure that any professional Java developer will be able to figure this out for him/herself.

Posts like that will get you banned quick fast.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 1:24 pm 
Newbie

Joined: Thu Jun 02, 2005 5:53 pm
Posts: 4
gavin wrote:
Of course it is possible.

I'm quite sure that any professional Java developer will be able to figure this out for him/herself.

Posts like that will get you banned quick fast.


Thanks for the helpful information.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 6:21 pm 
Newbie

Joined: Thu Jun 02, 2005 5:53 pm
Posts: 4
Looks like only the glorious and pleasant Gavin knows the answer and no one else is a professional hibernate developer. Just think, I've helped a number of open source projects and this hibernate thing is new to me. I've been reading about and developing a hibernate app for a week and it took only that long to figure out how wonderful and helpful the hibernate folks are to newbies.

Quite an inspiration to us all.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 04, 2005 3:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Please don't use Hibernate. (We don't take kindly to people who think we exist to do their job for them.)

Christian, please ban him.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 04, 2005 3:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
By the way, in case you don't know what you did wrong (always possible with people like you), it was not mainly that you asked a question that showed you were way too lazy to solve problems for yourself (by, eg, looking at examples, the sourcecode, etc), rather it was this rude, lazy and ignorant comment:

Quote:
I take the lack of replies as a sign that this is not possible


which was posted exactly 18 hours (!) after the original question (on a weekend).

The correct format of this comment is:

I take the lack of replies as a sign that either

(a) my question is too uninteresting and trivial or perhaps
(b) that the people who know the answer are too busy doing paying work to feed themselves/their family, or perhaps actually taking a break for once to spend some time with their friends/family, or (in one case) bring a new baby into the world and,

realizing that I am not the center of other people's universe, and that I am making use of a free support service for free open source software, I should perhaps take the time to investigate this problem for myself and maybe even try to understand how the code works (gasp!) or realize that it might take a few days for someone to get back to me with a response.



Does that sound wrong to you?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.