devxlogo

How to Cache Query Results

How to Cache Query Results

If em is the EntityManager, then the following query results will be cached:

Query query = em   .createQuery("SELECT u FROM User u");       query.setHint("eclipselink.cache-usage", "CheckCacheThenDatabase"); 

devx-admin

Share the Post: