Skip to main content

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.

Jump to: navigation, search

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...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

EclipseLink JPA

Eclipselink-logo.gif
EclipseLink
Website
Download
Community
Mailing ListForumsIRCmattermost
Issues
OpenHelp WantedBug Day
Contribute
Browse Source

Elug api package icon.png 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>

Eclipselink-logo.gif
Version: 2.4 DRAFT
Other versions...

Back to the top