openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "gonzalad (JIRA)" <>
Subject [jira] [Created] (OPENJPA-2327) QueryCache as hint
Date Wed, 23 Jan 2013 14:48:13 GMT
gonzalad created OPENJPA-2327:

             Summary: QueryCache as hint
                 Key: OPENJPA-2327
             Project: OpenJPA
          Issue Type: Bug
            Reporter: gonzalad

Provide a way to enable query cache as a query hint.

This would facilitate writing portable JPA applications.

For the time being, with OpenJPA, we need to execute the following code to cache the query

OpenJPAEntityManager oem = ((OpenJPAQuery<?>) query).getEntityManager();
OpenJPAEntityManagerFactory oemf = oem.getEntityManagerFactory();
QueryResultCache qcache = oemf.getQueryResultCache();;

It would be easier if JPA provided a query hint like :

query.setHint("openjpa.cacheable", cache);

This would even enable us to use it in a NamedQuery declaration :

@NamedQuery(name = "Civilite.findAll",
    query = "SELECT c FROM Civilite c", 
    hints = @QueryHint(name = "openjpa.cacheable", value = "true"))

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message