Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Left Outer Join With Curly Brackets
Left Outer Join With Curly Brackets [message #654253] Mon, 14 February 2011 13:56 Go to next message
Mauro Flores is currently offline Mauro Flores
Messages: 84
Registered: September 2009
Location: Brasil
Member
We are working with a proprietary jdbc driver to access a mainframe database(dmsII).
This driver implements SQL Ansi.

We are using eclipselink without specifying a TargetDataBase. All jpql queries are translated to sql ansi format and we had no problem so far.

But, we are facing a problem with a 'Left Outer Join'. The sql command is being build in a 'weird' way:

SELECT FROM {oj KICC66D t1 LEFT OUTER JOIN KICC110D t0 ON (t0.K110_ORG_REG = t1.K66_ORG_REG)}

This driver is complaining about the curly brackets.

Three questions:
- is this format with curly brackets correct for SQL ANSI ?
- what's the best TargetDataBase in order to generate just SQL ANSI format ?
- is there a property to say to eclipselink not to use curly brackets to build a left join command?

Thanks.
Re: Left Outer Join With Curly Brackets [message #654903 is a reply to message #654253] Thu, 17 February 2011 09:58 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

The {'oj syntax is part of the JDBC standard escape clause syntax.

You can disable it by defining your own DatabasePlatform subclass and defining the method,

shouldUseJDBCOuterJoinSyntax() {
return false;
}

Then set your platform using the "eclipselink.target-database" persistence.xml property.

If you databases syntax differs than the standard, you can refer to the source code for the other platform subclasses in, org.eclipse.persistence.platform.database.


James : Wiki : Book : Blog : Twitter
Previous Topic:double insert
Next Topic:EclipseLink & Cell Names with White Space
Goto Forum:
  


Current Time: Wed Aug 20 02:59:48 EDT 2014

Powered by FUDForum. Page generated in 0.01462 seconds