-->
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.  [ 3 posts ] 
Author Message
 Post subject: Help on associations
PostPosted: Fri Dec 12, 2003 8:09 am 
Newbie

Joined: Fri Dec 12, 2003 7:38 am
Posts: 5
Hi,

I've got the following data model

Train<------------->* train_rame *<--------------->rame

where tables look like that

train
---------
- cpt_train
-label_train

rame
-------
- cpt_rame
power

train_rame
-------------
- cpt_train
- cpt_rame

Could you post an example using HQL and another using criteria queries similar to the following sql query:

Code:
SELECT * FROM train , train_rame , rame where train.cpt_train = train_rame.cpt_train AND train_rame.cpt_rame = rame.cpt_rame AND rame.power > 10 and train.labeltrain = 'test';


Thanks ;)
Axen


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 8:45 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Would say the proper answer is RTFM. But it's almost Chrismas.
Code:
select train from Train as train inner join fetch train.rames as rame where rame.power > ? and train.lavenTrain = ?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 8:53 am 
Newbie

Joined: Fri Dec 12, 2003 7:38 am
Posts: 5
Of course I read the manual, but it is not clear....


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