javax.jdo.Extent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javax.jdo Show documentation
Show all versions of javax.jdo Show documentation
The Java Data Objects API (JDO) : a standard interface-based Java model abstraction of persistence, developed by the JCP.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Extent.java
*
*/
package javax.jdo;
import java.lang.Iterable;
import java.util.Iterator;
/** Instances of the Extent
class represent the entire collection
* of instances in the data store of the candidate class or interface
* possibly including its subclasses or subinterfaces.
* The Extent
instance has two possible uses:
*
* - to iterate all instances of a particular class or interface
*
- to execute a
Query
in the data store over all instances
* of a particular class or interface
*
* @version 2.1
*/
public interface Extent extends Iterable {
/** Returns an iterator over all the instances in the Extent
.
* The behavior of the returned iterator might depend on the setting of the
* ignoreCache
flag in the owning PersistenceManager
.
* @return an iterator over all instances in the Extent
*/
Iterator iterator();
/** Returns whether this Extent
was defined to contain subclasses.
* @return true if this Extent
was defined to contain instances
* that are of a subclass type.
*/
boolean hasSubclasses();
/** An Extent
contains all instances of a particular class
* or interface in the data
* store; this method returns the Class
of the instances
* represented by this Extent.
* @return the Class
of instances of this Extent
.
*/
Class getCandidateClass();
/** An Extent
is managed by a PersistenceManager
;
* this method gives access to the owning PersistenceManager
.
* @return the owning PersistenceManager
*/
PersistenceManager getPersistenceManager();
/** Close all Iterator
s associated with this Extent
instance.
* Iterator
s closed by this method will return false
* to hasNext()
and will throw
* NoSuchElementException
on next()
.
* The Extent
instance can still be used
* as a parameter of Query.setExtent
, and to get an Iterator
.
*/
void closeAll ();
/** Close an Iterator
associated with this Extent
instance.
* Iterator
s closed by this method will return false
* to hasNext()
and will throw NoSuchElementException
* on next()
. The Extent
instance can still be used
* as a parameter of Query.setExtent
, and to get an Iterator
.
* @param it an Iterator
obtained by the method
* iterator()
on this Extent
instance.
*/
void close (Iterator it);
/** Get the fetch plan associated with this Extent.
* @return the fetch plan
* @since 2.0
*/
FetchPlan getFetchPlan();
}