You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by MiƂosz Tylenda <mt...@o2.pl> on 2012/01/02 09:20:52 UTC

Re: Inheritance.JOINED, PostgreSQL and NATURAL JOIN

Hi Rade,

OpenJPA does not use NATURAL JOINs in the generated SQL statements, regardless of the dictionary you are using. What is used is either INNER/OUTER JOIN or SELECT ... WHERE syntax.

Regards,
Milosz


> Hello all.
> 
> I use OpenJPA (currently 2.1.0 version), PostgreSQL (currently 9.0). My model has one abstract class and many, many extended classes, and inheritance goes four levels deep and about 20 classes wide (please don't question the model, I am currently proposing the refactoring).
> 
> I have noticed that rather than generating NATURAL JOINS, OpenJPA (versions 1.2.2, 2.0.1 and 2.1.0) tends to generate SELECT ... WHERE statements. Is that so only in my case, or Postgres Dictionary is just set up that way? Is there a way to force NATURAL JOINs since all my entities and tables are made such that PKs and FKs bear the same name?
> 
> 
> Thanks for the response!
>