Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
EclipseLink/UserGuide/JPA/Basic JPA Development/Caching/Indexes
< EclipseLink | UserGuide | JPA | Basic JPA Development | Caching
Revision as of 10:09, 24 May 2012 by Unnamed Poltroon (Talk) (New page: {{EclipseLink_UserGuide |info=y |toc=n |eclipselink=y |eclipselinktype=JPA |api=y |apis= *[http://www.eclipse.org/eclipselink/api/latest/org/eclipse/persistence/annotations/CacheIndex.html...)
EclipseLink JPA
EclipseLink | |
Website | |
Download | |
Community | |
Mailing List • Forums • IRC • mattermost | |
Issues | |
Open • Help Wanted • Bug Day | |
Contribute | |
Browse Source |
Key API
Native API
Cache Indexes
Expiry can also be used in the query results cache (see Query Results Cache).
Cache index annotation example
... @Entity @Cache( expiry=600000 // 10 minutes ) public class Employee { ... }
... @Entity @Cache( expiryTimeOfDay=@TimeOfDay(hour=3) // 3:00 AM ) public class Project { ... }
Cache index XML example
<?xml version="1.0"?> <entity-mappings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eclipse.org/eclipselink/xsds/persistence/orm http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_4.xsd" version="2.4"> <entity name="Employee" class="org.acme.Employee" access="FIELD"> <cache> <expiry>600000</expiry> </cache> </entity> <entity name="Project" class="org.acme.Project" access="FIELD"> <cache> <expiry-time-of-day hour="3"/> </cache> </entity> </entity-mappings>