Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] NamedQuery generating bad sql for quoted column

Ok, so I have the following NamedQuery:

@NamedQuery(name = "findComp", query="SELECT c FROM Component c")

And column in an entity:

	@Column(name="`Key`")
	private String key;

I get a SQL error for the generated SQL:

... `Key` AS `Key`22 ...

Which is obviously bad SQL but without the quoted field name the SQL is
equally wrong:

... Key AS Key22 ...


I don't have the option of renaming the columns.  I'm prototyping something
to prove how great JPA/EclipseLink is so we can start using it in our team. 
Obviously I'll get laughed at if there's just no way to handle reserved
words like this :-)

I'm using EclipseLink 2.0

-- 
View this message in context: http://old.nabble.com/NamedQuery-generating-bad-sql-for-quoted-column-tp29424296p29424296.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top