-->
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.  [ 3 posts ] 
Author Message
 Post subject: HSQLDB, LEFT OUTER JOIN and discriminators
PostPosted: Thu Oct 06, 2005 4:22 pm 
Newbie

Joined: Wed Sep 14, 2005 12:17 pm
Posts: 13
I suspect that this is just a case where Hibernate can't help, but I have a set of relationships that I'm trying to initialize in one select statement.

One of those relationships uses a discriminator-based subclass (with two values, 'IN' and 'CM'), and as a result, the following clause appears in my SELECT:

Code:
left outer join CL01_CLAIMPARTY claimparti4_
on claim2_.COMPANY=claimparti4_.COMPANY
and claim2_.CLAIMNO=claimparti4_.CLAIMNO
and claimparti4_.REFASSOC in ('IN', 'CM')


It appears that HSQLDB doesn't like an "in" statement to appear in a left outer join, and I get an exception when the statement is executed. Can anyone suggest a tweak that might help me bypass the problem?

Hibernate version: 3.0.5

Full stack trace of any exception that occurs:

org.hibernate.util.JDBCExceptionReporter - not allowed in OUTER JOIN condition in statement

Name and version of the database you are using:

HSQLDB 1.8.0

The generated SQL (show_sql=true):

left outer join CL01_CLAIMPARTY claimparti4_
on claim2_.COMPANY=claimparti4_.COMPANY
and claim2_.CLAIMNO=claimparti4_.CLAIMNO
and claimparti4_.REFASSOC in ('IN', 'CM')


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 09, 2005 9:11 am 
Beginner
Beginner

Joined: Sat Oct 08, 2005 2:13 am
Posts: 47
hi
I think u must change the hql to this

left outer join CL01_CLAIMPARTY claimparti4_
on claim2_.COMPANY=claimparti4_.COMPANY
and claim2_.CLAIMNO=claimparti4_.CLAIMNO
where
claimparti4_.REFASSOC in ('IN', 'CM')


hope this help


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 09, 2005 9:20 am 
Beginner
Beginner

Joined: Sat Oct 08, 2005 2:13 am
Posts: 47
or maybe this help u :

left outer join CL01_CLAIMPARTY claimparti4_
on claim2_.COMPANY=claimparti4_.COMPANY
and claim2_.CLAIMNO=claimparti4_.CLAIMNO as joinAlias
with joinAlias.REFASSOC in ('IN', 'CM')


I am not sure that as joinAlias where should be placed maybe

left outer join CL01_CLAIMPARTY claimparti4_ as joinAlias
on claim2_.COMPANY=claimparti4_.COMPANY
and claim2_.CLAIMNO=claimparti4_.CLAIMNO
with joinAlias.REFASSOC in ('IN', 'CM')


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.