Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: re[eclipselink-users] served keywords

The automatic support is currently based on the JPA 2.0 specification which allows quotes to be automatically enabled through a delimited-identifier tag in the persistence-unit-defaults section of orm.xml.

There is no property currently available for JPA 1.0 applications and as such you need to quote reserved words explicitly.

James Sutherland wrote:
To handle reserved words you need to quote them.  You can do this when you
define your mappings, just give the column name as "\"TO\"" instead of "to".

EclipseLink 2.0 (1.2 as well) (JPA 2.0) support automatically quoting
columns as well.

I think the property is,
"eclipselink.database.delimiters"="true"


Derek Knapp-3 wrote:
I'm switching to exlipselink from toplink for some of the new features (mainly the batch and fetch query hints) however, I'm encountering one problem.. I have some entities with columns that have reserved names.. for example, "to" and "from" (it is a table to store an email). The problem is with the following query.

"select e from Email e where e.id = :id"

in toplink, this wasn't a problem.. the query it would generate is

"SELECT t0.id, t0.subject, t0.to, t0.from FROM email t0 where t0.id = 1"

but in eclipselink, its not adding the t0. to the list of columns... aka its generating the following sql

"SELECT id, subject, to, from FROM email t0 where t0.id = 1"

which is clearly invalid....


is there any way in eclipselink to make it add the t0. ? or is the only solution to rename the columns in the database (which would be a large amount of work :( )




-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink , http://wiki.oracle.com/page/TopLink TopLink Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , http://www.nabble.com/EclipseLink-f26430.html EclipseLink Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence


Back to the top