| Issue 28: | Cannot use as a Named Query | |
| 2 people starred this issue and may be notified of changes. | Back to list |
It would be nice if we can use liquidform type of API as a named query. Is it not possible to call something like Hibernate's ExtendedMappings.addQuery(String name, NamedQueryDefinition query) at init time and register the queries so that the queries are cached, verified and named ahead of time?
Dec 9, 2008
The problem with the static variable is the queries are not validated and cached at app load time. Adding to ExtendedMappings.addQuery(), or something like that (not sure how to do with JPA) provides the same means of accessing named queries as a string based named query. Even better if the names themselves can be non-string based.. perhaps an enum?
Dec 16, 2008
I'm not sure I understand what you expect from LIQUidFORM. Why not use LIQUidFORM to build the query that you then add to your JPA engine (using ExtendedMappings.addQuery() in your case) at app load time ? More precisely, what could we add to make your life better (keeping in mind that we want to stay engine agnostic for the time being) ?
Dec 29, 2008
Marking as Milestone 1.0 but will close soon as WONTFIX if no further discussion on this issue. If anything of value can be added to LF for release 1.0.0, we'll try to fit it in though.
Labels:
Milestone-Release1.0
Feb 13, 2009
(No comment was entered for this change.)
Status:
WontFix
|
Can you be more specific ? Although LIQUidFORM produced queries can't be used with @NamedQueries/@NamedQuery (but this is a Java annotations "limitation" as they require blank final Strings), you can still produce them at init time (as stated on p18 of the manual). So you can do something like ... private static final String q; static { q = select().from().where().toString(); } Regarding the use of ExtendedMappings, keep in mind that the current vision behind LIQUidFORM is to stay engine agnostic. But you can call it yourself if you wish. Does this answer your question ?