Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » left outer join with JPQL(Help with joins)
left outer join with JPQL [message #530724] Fri, 30 April 2010 12:04 Go to next message
Eclipse UserFriend
Sorry for being a newbie! I guess I don't quite get JPQL.

I am trying to execute the followin JPQL:

select a.f1,a.f2,b.f3 from A a LEFT OUTER JOIN B b ON (a.f1 = b.f1 and a.time = b.time)
where a.id = b.id and
a.match = b.match;

I noticed that in a lot of joins and/or outer joins - you use syntax where the entity your joining is mapped in the first entity your selecting data from. For instance

select c.one,d.two from C c OUTER LEFT JOIN c.d d
** But this implies that the entity is mapped in the first entity 'C'.

The SQL that I am trying to perform is:
select a.f1,a.f2,b.f3 from A a LEFT OUTER JOIN B b
where a.id = b.id and
a.match = b.match
and a.f1 = b.f1
and a.time = b.time;

Again in my scenario, Entity A does not contain Entity B.

Thanks
Re: left outer join with JPQL [message #531068 is a reply to message #530724] Mon, 03 May 2010 11:22 Go to previous message
Eclipse UserFriend
JPQL does not support an ON clause in outer joins. You can only define outer joins on relationships.

You either need to add the relationship, use an inner join, or use a native SQL query.

Feel free to log an enhancement request to have this support added.
Previous Topic:JPA/JTA eclipselink oracle proxy authentication problem
Next Topic:How to map an association with an Enum
Goto Forum:
  


Current Time: Wed Jul 23 15:09:34 EDT 2025

Powered by FUDForum. Page generated in 0.05378 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top