-->
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: How to make a join with Criteria among two "unlinked" tables
PostPosted: Thu Jan 30, 2014 9:30 am 
Newbie

Joined: Thu Jan 30, 2014 9:15 am
Posts: 2
Hi,

I've read a lot of documentation but I didn't understand how to perform a join yet.

I have two tables having 1 column each:

Table1:
ID
10435562
2673958
649688
6620837
8543654

Table2:
ID
6620837
8543654

No foreign keys are present.

I want to perform the following SQL query using Hibernate Criteria:
Code:
select t1.id
from table1 t1 join table2 t2 on t1.id = t2.id;


I don't understand if I have to create some foreign key and then create Aliases to be able to do the join or not.


Could somebody explain me how to do that please?


Top
 Profile  
 
 Post subject: Re: How to make a join with Criteria among two "unlinked" tables
PostPosted: Mon Feb 03, 2014 9:14 am 
Newbie

Joined: Thu Jan 30, 2014 9:15 am
Posts: 2
OK,

I guess a SQL or HQL query is necessary for that.
Thank you anyway.


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.