Hi,
The problem of nativeQuery is that the string query parameter is passing directly to em for query creation and execution, without abilities to set QueryParameters. This becomes a problem when there is a need to set sql dialect specific data. Date is a good example for that. String representation of date is different for different dialects. Anyway - I will change entirely the way of fetching logentries. Thank you for support.
Regards,
Stefan

Hi,

True, only the way you get the em is container dependant.
AuditReader interface exposes a nativeQuery method that you can use to send a ejbql query, is that not enough?

Tiry

On 22 Nov 2009 15:26, "Stefan Dimov" <[email protected] <mailto:[email protected]>> wrote:

Hi Thierry,
Thanks for detailed explanation. Now I know how to workaround the problems. But... I'm not sure using of JPA is a deployment dependent. May be the way of getting JPA configuration is container dependent, but using it I think not. Using of JPA as a wrap of sql backend gives me a lot of advantages like unified construction of queries without troubles to detect sql dialect, etc...
Currently exposed API  of ejbs

- Logs.class - AuditReader.class - AuditLogger.class - AuditAdmin.class

do not give abilities for complex queries. For example if I need to search for events, created by a set of users and for a given time window, this is really hard to implement, not impossible, but hard. That is why I'm wandering of such encapsulation of implementation without a hook to direct access of JPA, as the service had in previous releases.

Regards,
Stefan.

> Hi, > > You are not supposed to access directly the entitymanager otherwise your code will dep...


_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm

Reply via email to