openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Gonzalez <adr_gonza...@yahoo.fr>
Subject Portable way to use query cache
Date Wed, 23 Jan 2013 09:38:41 GMT
Hello,

I'm a newbie with openJPA, I would like to know what's the best way to do query caching (in
a JPA 2.x portable way).
My webapp will run on JBoss 7.x (Hibernate) and Websphere 8 (OpenJPA).


From , [1] there's some proprietary API involved.

Is there a portable way, i.e. using hints instead [2]?

Thanks !

[1] http://openjpa.apache.org/builds/2.0.1/apache-openjpa-2.0.1/docs/manual/main.html
OpenJPAEntityManagerFactory oemf = OpenJPAPersistence.cast(emf);
QueryResultCache qcache = oemf.getQueryResultCache();

[2] entityManager.createNamedQuery(
NamedQueries.ETAT_CONTRAT_FIND_ALL, EtatContrat.class).setHint("openjpa.querycache", true);

Mime
View raw message