-->
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.  [ 5 posts ] 
Author Message
 Post subject: can I use outer join in HSQL for 2 class without relation?
PostPosted: Tue Aug 21, 2007 12:02 am 
Newbie

Joined: Wed Nov 24, 2004 7:58 pm
Posts: 9
I have 2 classes which has no reference relation between them (for some reason, I can not do any mapping in them)
For instance,

Code:
class Resource{
int uid,
int name
}

class Page{
int uid
int uuid
...
}


basically, Resource.name=Page.uuid. I can use such native SQL here:
select * from resource as r left outer join page as p on r.name = p.uuid where p.uid=1

In other words, I just want to use "on" keyword to declare joined fields. Is it possible in HSQL or others Hibernate format (except native SQL?)

Thanks


Top
 Profile  
 
 Post subject: further explaination
PostPosted: Tue Aug 21, 2007 12:06 am 
Newbie

Joined: Wed Nov 24, 2004 7:58 pm
Posts: 9
The reason I don't use native SQL is, I try to avoid hard-code table name in query string. So, it is good suggestion as well if it makes me to avoid table name hardcode (e.g, using class name instead).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 21, 2007 12:20 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
HQL require the relation to be defined to use outer join.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 21, 2007 1:00 am 
Newbie

Joined: Wed Nov 24, 2004 7:58 pm
Posts: 9
so, it means impossible to avoid table name in hardcode in my case?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 21, 2007 5:55 am 
Senior
Senior

Joined: Thu May 17, 2007 2:31 am
Posts: 194
Location: Sri Lanka
hi

try to use criteria


Amila
(Don't forget to rate if helps)


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