-->
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.  [ 1 post ] 
Author Message
 Post subject: criteria query API
PostPosted: Fri Mar 31, 2006 5:15 am 
Newbie

Joined: Tue Mar 28, 2006 6:18 am
Posts: 2
Hello,
I´d like to create a simple join between 2 table (classes).
I want to use the "criteria query API":


Code:

public class1{

int id1;
string name1;
}


public class2{

int id2;
string name2;
}
//the tables in the db are exactly the same



When I use native SQL, the statement looks like this:

Select class1.*, class2.* from class1,class2 where
class1.id1 = 1 and
class1.id1 = class2.id2

How could I create this statement with the QueryAPI ?
Do I have put some additional lines in the mapping file ?

I´ve tried the Example at Chapter 12.4 Associations, but i´ve got an error in the CreateCriteria("Kittens - (here class2") :
Could not found class "class2" ?

Please can someone give me a simple example and some hints, to solve my problem and to make the first steps easier ...


Thanks a lot,
Slowhand


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

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.