-->
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: Sub Query
PostPosted: Thu Dec 02, 2004 11:28 am 
Newbie

Joined: Thu Dec 02, 2004 11:20 am
Posts: 1
[b]Hibernate version:[/b] 2.1

[b]Mapping documents:[/b] Hibernate in action

[b]Code between sessionFactory.openSession() and session.close():[/b]

[b]Full stack trace of any exception that occurs:[/b]

[b]Name and version of the database you are using:[/b]

[b]The generated SQL (show_sql=true):[/b]

[b]Debug level Hibernate log excerpt:[/b]

Hi ,

I am a biggner in Hibernate. I want to write a HQL query using sub queries.
I through the "Hibernate in Action" book but could not find a suitable answer for my
problem.

My select query looks like this

[code]Select u.* from users u
where u.manager_Id = 1
and u.id not in (Select User_id from OBJECTIVES where
assigned_Obj_Id in (1,2,3)) [/code]

I have a many-to-one mapping from Objectives to User in objectives.hbm but not the other
way round

can any body tell me the appropriate HQL Query

Thanks in Advance
[b]Vinay[/b]


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.