Joined: Thu Nov 02, 2006 11:23 pm Posts: 4
|
Hi All:
I have two tables which are mapped independently in the hbm.xml Files. They donot have any kind of one to one or many-to many etc relationship specified in Mapping.
I would like to do something like the following using an Inner Join with the Criteria APIs:
select tab1.* from TABLE_1 tab1, TABLE_2 tab2 where tab1.licenceNumber = tab2.licenceNumber and tab2.score > 50
The result of the ArrayList produced must give me an ArrayList of the Table_1 Class.
Can anyone pls give me the syntax using Criteria API.
So far my search in google and other books has given me the Impression that inner joins are only possible when the Objects have a has-a relationship with one another.
Pls tell me if this is so - in which case I cannot write an INNER JOIN for the above SQL using Criteria API.
Thanks.
Chetan
PS. If Criteria cannot be used I am ok with HQL.
|
|