Forums Register Login

NamedQuery

+Pie Number of slices to send: Send
Source: Maikalai Zaikin's notes.

Given:



When invoking this query from another bean,.... Given,


Is it legal to call to that named query as "magsOverPrice"?
Shouldn't it be "Magazine.magsOverPrice" ?
+Pie Number of slices to send: Send
Named queries are persistence-unit scoped, so the names are global and must be unique per unit. Thus, you don't prefix it with anything as it doesn't add any meaning.
+Pie Number of slices to send: Send
I understood! Thank you Raf
+Pie Number of slices to send: Send
Raf,

What would be the result if a entity tries to access a query, out of the entity's persistence-unit?
+Pie Number of slices to send: Send
EntityManager.createNamedQuery() throws IllegalArgumentException in this case. See the API.

Raf
+Pie Number of slices to send: Send
Thanks! got it!
+Pie Number of slices to send: Send
[ARG: Removed BA post ]
You don't like waffles? Well, do you like this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 766 times.
Similar Threads
Java Compilation Error: "illegal start of expression: })"
NullPointerException returned usig a StoredProcedureCall
Mapping to an xml typed column (PostgreSQL) on an EJB3 entity in JBoss 5.1
JPA table JOIN
HQL: how to use collection value expressions?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:18:52.