org.datanucleus.store.rdbms.extent
Class ClassViewExtent

java.lang.Object
  extended by org.datanucleus.store.AbstractExtent
      extended by org.datanucleus.store.rdbms.extent.AbstractRDBMSExtent
          extended by org.datanucleus.store.rdbms.extent.ClassViewExtent
All Implemented Interfaces:
org.datanucleus.store.Extent, org.datanucleus.store.mapped.expression.Queryable

public class ClassViewExtent
extends AbstractRDBMSExtent
implements org.datanucleus.store.mapped.expression.Queryable

An Extent of all persistent objects backed by a view.


Field Summary
protected static org.datanucleus.util.Localiser LOCALISER_RDBMS
          Localised messages
 
Fields inherited from class org.datanucleus.store.rdbms.extent.AbstractRDBMSExtent
query, queryResultsByIterator
 
Fields inherited from class org.datanucleus.store.AbstractExtent
candidateClass, cmd, LOCALISER, om, storeMgr, subclasses
 
Constructor Summary
ClassViewExtent(org.datanucleus.ObjectManager om, org.datanucleus.store.mapped.DatastoreClass view, java.lang.Class cls, boolean subclasses, org.datanucleus.metadata.AbstractClassMetaData cmd)
          Constructor.
 
Method Summary
 boolean isEmpty()
          Returns true if this collection contains no elements.
 org.datanucleus.store.mapped.expression.QueryExpression newQueryStatement()
          Create a new query to search for the candidate classes etc.
 org.datanucleus.store.mapped.expression.QueryExpression newQueryStatement(java.lang.Class candidateClass, org.datanucleus.store.mapped.DatastoreIdentifier candidateAlias)
          Create a query to search for the candidateClass and subclasses if true
 org.datanucleus.store.query.ResultObjectFactory newResultObjectFactory(org.datanucleus.store.mapped.expression.QueryExpression stmt, boolean ignoreCache, java.lang.Class resultClass, boolean useFetchPlan)
          Create a new factory for objects from the ResultSet.
 
Methods inherited from class org.datanucleus.store.rdbms.extent.AbstractRDBMSExtent
close, closeAll, getFetchPlan, iterator
 
Methods inherited from class org.datanucleus.store.AbstractExtent
getCandidateClass, getObjectManager, hasSubclasses, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCALISER_RDBMS

protected static final org.datanucleus.util.Localiser LOCALISER_RDBMS
Localised messages

Constructor Detail

ClassViewExtent

public ClassViewExtent(org.datanucleus.ObjectManager om,
                       org.datanucleus.store.mapped.DatastoreClass view,
                       java.lang.Class cls,
                       boolean subclasses,
                       org.datanucleus.metadata.AbstractClassMetaData cmd)
Constructor.

Parameters:
om - Persistence Manager
view - The view
cls - Candidate class
subclasses - Whether to include subclasses
cmd - MetaData for the candidate class
Method Detail

newQueryStatement

public org.datanucleus.store.mapped.expression.QueryExpression newQueryStatement()
Create a new query to search for the candidate classes etc.

Specified by:
newQueryStatement in interface org.datanucleus.store.mapped.expression.Queryable
Returns:
The new QueryStatement.

newQueryStatement

public org.datanucleus.store.mapped.expression.QueryExpression newQueryStatement(java.lang.Class candidateClass,
                                                                                 org.datanucleus.store.mapped.DatastoreIdentifier candidateAlias)
Create a query to search for the candidateClass and subclasses if true

Specified by:
newQueryStatement in interface org.datanucleus.store.mapped.expression.Queryable
Parameters:
candidateClass - The class to use
candidateAlias - Alias for the candidate
Returns:
The new QueryStatement

newResultObjectFactory

public org.datanucleus.store.query.ResultObjectFactory newResultObjectFactory(org.datanucleus.store.mapped.expression.QueryExpression stmt,
                                                                              boolean ignoreCache,
                                                                              java.lang.Class resultClass,
                                                                              boolean useFetchPlan)
Create a new factory for objects from the ResultSet.

Specified by:
newResultObjectFactory in interface org.datanucleus.store.mapped.expression.Queryable
Parameters:
stmt - The Query Statement
ignoreCache - Whether to ignore dirty objects
resultClass - Whether to create objects of a particular class
useFetchPlan - whether to use the fetch plan to retrieve fields in the same query
Returns:
The result object factory

isEmpty

public boolean isEmpty()
Returns true if this collection contains no elements.

Specified by:
isEmpty in interface org.datanucleus.store.mapped.expression.Queryable
Returns:
true if this collection contains no elements.


Copyright © 2009. All Rights Reserved.