[jpa-spec users] Location of named queries

From: Karsten Wutzke <>
Date: Sat, 28 Apr 2012 23:47:05 +0200 (CEST)
Hello JPA experts,

I have a question regarding named queries.

AFAIK they can only be placed onto entities via annotations. For people using code generators for their entities, this isn't an option. Working around it by using XML as described here is useful but suboptimal. Overall, putting named queries onto entities and falling back to XML in an annotation-only world is pretty clumsy IMHO.

Q: Aren't there any plans to improve the situation in the upcoming JPA spec?

I'd really like to put them into my service layer. I would really like to see some improvement here.

Can it be done?

Comments appreciated.

Karsten Wutzke

Ihr WEB.DE Postfach immer dabei: die kostenlose WEB.DE Mail App für iPhone und Android.