-->
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.  [ 4 posts ] 
Author Message
 Post subject: Column Functions
PostPosted: Fri Oct 31, 2003 5:34 pm 
Regular
Regular

Joined: Tue Sep 02, 2003 5:09 pm
Posts: 81
Location: Whitefish Montana
Is there any way to join tables that do not have a specific mapping defined? Here is a simple example:

select Header, Detail from Header as Header join Detail as Detail on Header.detailId = Detail.id

When I try this I get "outer or full join must be followed by path expression". The join notation should be much more efficient than:

select Header, Detail from Header as Header, Detail as Detail where Header.detailId = Detail.id

This last query does work.

Thanks,

David Morris


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 31, 2003 7:46 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Use a where clause join ("theta style").


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 01, 2003 11:37 am 
Regular
Regular

Joined: Tue Sep 02, 2003 5:09 pm
Posts: 81
Location: Whitefish Montana
That was the conclusion I came to. I haven't worked through every case where I may need this but I may hit a left join. For Oracle, with the old style (+) syntax it wouldn't be too bad but for DB2 it will be quite a bit slower. I may have to fall back to iBatis for this.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 01, 2003 6:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
For this very rare case, just use createSQLQuery()


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.