-->
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: JPA - Entity outer joins and inheritance
PostPosted: Mon Mar 03, 2008 1:26 pm 
Newbie

Joined: Mon Mar 03, 2008 1:04 pm
Posts: 1
Hello,
I've the following problem.
These are my tables:
- TESTA
A_ID NUMBER(5) NOT NULL,
DESCRIPTION VARCHAR2(50) NULL

- TESTB
B_ID NUMBER(5) NOT NULL,
DESCRIPTION VARCHAR2(50) NULL,
STATE NUMBER(1) NOT NULL

-TESTC
A_ID NUMBER(5) NOT NULL,
B_ID NUMBER(5) NOT NULL

where TESTC is a join table.

I'm trying to use JPA Entities to do the following query:
SELECT A.*, B.STATE
FROM
TESTB B JOIN TESTC ON ( B.B_ID=C.B_ID AND B.STATE=2 )
RIGHT OUTER JOIN TESTA ON ( A.A_ID=C.A_ID)

I've tried a lot of mappings but I always get wrong results or errors. I've also tried making an inherited entity on TestB with a discriminatorValue of 2 but it didn't work.

I'm using Hibernate 3.2.4.sp1 on Seam 2.0.1.ga.

Can anyone help me ?

Thanks a lot


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.