3.10.2.4. Extent
An Extent is a logical view of all persistent instances of a given entity class, possibly including subclasses.
OpenJPA adds the
org.apache.openjpa.persistence.Extent class to the set of Java Persistence APIs.
The following code illustrates iterating over all instances of the Magazine entity, without subclasses:
Example 130. Using a JPA Extent
import org.apache.openjpa.persistence.*;
...
OpenJPAEntityManager kem = OpenJPAPersistence.cast(em);
Extent<Magazine> mags = kem.createExtent(Magazine.class, false);
for (Magazine m : mags)
processMagazine(m);