com.triactive.jdo.store
Class ClassViewExtent

java.lang.Object
  extended bycom.triactive.jdo.store.ClassViewExtent
All Implemented Interfaces:
javax.jdo.Extent, Queryable

class ClassViewExtent
extends java.lang.Object
implements javax.jdo.Extent, Queryable

An Extent of all persistent objects backed by a view.

Author:
Mike Martin
See Also:
Extent

Constructor Summary
ClassViewExtent(PersistenceManager pm, ClassView view, boolean subclasses)
           
 
Method Summary
 void close(java.util.Iterator it)
          Close an Iterator associated with this Extent instance.
 void closeAll()
          Close all Iterators associated with this Extent instance.
 java.lang.Class getCandidateClass()
          An Extent contains all instances of a particular Class in the data store; this method returns the Class of the instances
 javax.jdo.PersistenceManager getPersistenceManager()
          An Extent is managed by a PersistenceManager; this method gives access to the owning PersistenceManager.
 boolean hasSubclasses()
          Returns whether this Extent was defined to contain subclasses.
 java.util.Iterator iterator()
          Returns an iterator over all the instances in the Extent.
 QueryStatement newQueryStatement()
          Returns a prototypical query statement over the underlying collection.
 QueryStatement newQueryStatement(java.lang.Class candidateClass)
          Returns a prototypical query statement over the underlying collection, pre-filtered to include only objects of the specified class.
 Query.ResultObjectFactory newResultObjectFactory(QueryStatement stmt)
          Returns a suitable query result factory for results produced by the specified query.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassViewExtent

public ClassViewExtent(PersistenceManager pm,
                       ClassView view,
                       boolean subclasses)
Method Detail

iterator

public java.util.Iterator iterator()
Returns an iterator over all the instances in the Extent.

Specified by:
iterator in interface javax.jdo.Extent
Returns:
an iterator over all the instances in the Extent.

hasSubclasses

public boolean hasSubclasses()
Returns whether this Extent was defined to contain subclasses.

Specified by:
hasSubclasses in interface javax.jdo.Extent
Returns:
true if this Extent was defined to contain instances that are of a subclass type

getCandidateClass

public java.lang.Class getCandidateClass()
An Extent contains all instances of a particular Class in the data store; this method returns the Class of the instances

Specified by:
getCandidateClass in interface javax.jdo.Extent
Returns:
the Class of instances of this Extent

getPersistenceManager

public javax.jdo.PersistenceManager getPersistenceManager()
An Extent is managed by a PersistenceManager; this method gives access to the owning PersistenceManager.

Specified by:
getPersistenceManager in interface javax.jdo.Extent
Returns:
the owning PersistenceManager

close

public void close(java.util.Iterator it)
Close an Iterator associated with this Extent instance. Iterators 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.setCandidates, and to get an Iterator.

Specified by:
close in interface javax.jdo.Extent
Parameters:
it - an iterator obtained by the method iterator() on this Extent instance.

closeAll

public void closeAll()
Close all Iterators associated with this Extent instance. Iterators 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.setCandidates, and to get an Iterator.

Specified by:
closeAll in interface javax.jdo.Extent

newQueryStatement

public QueryStatement newQueryStatement()
Description copied from interface: Queryable
Returns a prototypical query statement over the underlying collection.

The returned query statement selects all applicable rows from the relevant base table(s) and the column that represents the element or element ID. The statement can then be modified to join additional tables, select more columns, add WHERE conditions, etc.

Specified by:
newQueryStatement in interface Queryable
Returns:
The new prototypical query statement.

newQueryStatement

public QueryStatement newQueryStatement(java.lang.Class candidateClass)
Description copied from interface: Queryable
Returns a prototypical query statement over the underlying collection, pre-filtered to include only objects of the specified class.

Specified by:
newQueryStatement in interface Queryable
Returns:
The new prototypical query statement.
See Also:
Queryable.newQueryStatement()

newResultObjectFactory

public Query.ResultObjectFactory newResultObjectFactory(QueryStatement stmt)
Description copied from interface: Queryable
Returns a suitable query result factory for results produced by the specified query.

The stmt argument must have been obtained by a previous call to newQueryStatement() on the same Queryable.

Specified by:
newResultObjectFactory in interface Queryable
Returns:
A factory for creating PersistenceCapable objects from query results.

toString

public java.lang.String toString()


Copyright © 2001 TriActive, Inc. All Rights Reserved.