-->
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: Native SQL in subqueries
PostPosted: Tue Mar 09, 2004 10:25 am 
Newbie

Joined: Tue Feb 03, 2004 10:02 am
Posts: 2
Hi,

I have a class, let's say Customer, that is mapped on a certain table.
I'd like to know how to write a HQL query that uses as condition a subquery on a table not mapped on a class.

Here is an example:

from Customer as customer where customer.name in (select my_column from my_unmapped_table)

When I try this query, Hibernate tries to map my_unmapped_table which I'm not interested to map.

More generally, is there a way to include in the HQL where clause some SQL text and instruct Hibernate to pass it as it is to the JDBC driver?

Thank you very much for your help.


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.