Skip to main content

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

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 
-- 
View this message in context: http://www.nabble.com/reserved-keywords-tp25266535p25277742.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top