[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Problem with Query and specially named columns
|
JPA allows your identifiers to be delimited. From the spec:
To specify delimited identifiers, one of the following approaches must be used:
• It is possible to specify that all database identifiers in use for a
persistence unit be treated as
delimited identifiers by specifying the <delimited-identifiers/> element within the
persistence-unit-defaults element of the object/relational xml mapping file. If the
<delimited-identifiers/> element is specified, it cannot be overridden.
• It is possible to specify on a per-name basis that a name for a database
object is to be interpreted
as a delimited identifier as follows:
• Using annotations, a name is specified as a delimited identifier by enclosing
the name
within double quotes, whereby the inner quotes are escaped, e.g.,
@Table(name="\"customer\"").
• When using XML, a name is specified as a delimited identifier by use of double
quotes, e.g., <table name=""customer""/>[25]
On 26/07/2012 1:31 PM, Michael Simons wrote:
Hello,
We've got a table (OI) with columns named like "AED#".
The JPQL Query "select x from OI as x where x.ovak != :ovak1 and x.ovak != :ovak2"
produces as SQL Query:
SELECT AFNR, FIR, STS, TRKZ, AED#, ESD#, USR, OVAK FROM OI WHERE ((OVAK<> ?) AND (OVAK<> ?))
But it should be
SELECT AFNR, FIR, STS, TRKZ, "AED#", "ESD#", USR, OVAK FROM OI WHERE ((OVAK<> ?) AND (OVAK<> ?))
Any hints what I can do to solve or work-around this?
The solution I have in mind is to build a view to "rename" the columns.
Kind Regards,
Michael Simons
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users