Params on NamedNativeQuery

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Params on NamedNativeQuery

John Arevalo
CONTENTS DELETED
The author has deleted this message.
tch
Reply | Threaded
Open this post in threaded view
|

Re: Params on NamedNativeQuery

tch
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Params on NamedNativeQuery

John Arevalo
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Params on NamedNativeQuery

jamesssss
The JPA syntax for arguments in native queries is "?".

"SELECT * FROM City WHERE cityId=?"

or,
"SELECT * FROM City WHERE cityId=?1"

Named parameters (:name) are not allowed.  Although I agree it is confusing that JPQL allows named parameters, and SQL queries do not, feel free to log a bug for this.

You may also be able to use EclipseLink native argument syntax "#".

"SELECT * FROM City WHERE cityId=#cityId"

Edilson-2 wrote
Thanks for your reply.

without quotes throws SQLSyntaxException, looks like eclipseLink does
not mapping params, instead is executing plain query.


--
John Arévalo
GNU/Linux User #443701
http://counter.li.org/
Reply | Threaded
Open this post in threaded view
|

Re: Params on NamedNativeQuery

John Arevalo
CONTENTS DELETED
The author has deleted this message.