An extent provides you with access to all the persistent instances
of a class and, optionally, its subclasses. You can iterate over the
elements of the extent or perform a query on the extent. The JDO
Extent interface represents the
extent of a class. Later in this chapter, we will discuss the
IgnoreCache flag, which controls whether
instances made persistent or deleted during the current transaction are
contained in the extent.
You control whether an extent is maintained for a class in the
metadata. You use the metadata
attribute to indicate whether the persistent class has an extent. It has
a default value of "
If your application does not need to iterate over the instances of
a class or perform a query on the extent, you can set the
requires-extent attribute to "
false" explicitly. Even if a class does not
have an extent, you can still make instances persistent, establish
references to them, and navigate to them in your application and
JDO 1.0.1 requires that if a class has a
requires-extent set to "
true“, none of its subclasses can set
requires-extent to "
false“. If your application specifies the
subclass’s parameter to be
getExtent( ) method for a
base class, all subclass instances are included in the iteration of the
You access the
associated with a class by calling the following
Extent getExtent(Class persistentClass, boolean subclasses); ...