org.datanucleus.store.mapped.expression
Interface CollectionStoreQueryable

All Known Implementing Classes:
AbstractCollectionStore, AbstractListStore, AbstractSetStore, FKListStore, FKSetStore, JoinListStore, JoinSetStore, MapKeySetStore, MapValueSetStore

public interface CollectionStoreQueryable

Interface representation of the querying capabilities of a backing store for a collection. This is part of the JDOQL "expression" design that will be refactored out when the new query engine replaces it.


Method Summary
 QueryExpression getExistsSubquery(QueryExpression parentStmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTableExpr, DatastoreIdentifier existsTableAlias)
          Create a subquery for the given query that selects elements, joining to the owner table.
 QueryExpression getSizeSubquery(QueryExpression parentStmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTableExpr, DatastoreIdentifier sizeTableAlias)
          Create a subquery for the size of the collection.
 ScalarExpression joinElementsTo(QueryExpression stmt, QueryExpression parentStmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTableExpr, DatastoreIdentifier collectionTableAlias, java.lang.Class filteredElementType, ScalarExpression elementExpr, DatastoreIdentifier elementTableAlias, boolean existsQuery)
          Method used in queries when contains() has been invoked.
 

Method Detail

getExistsSubquery

QueryExpression getExistsSubquery(QueryExpression parentStmt,
                                  JavaTypeMapping ownerMapping,
                                  LogicSetExpression ownerTableExpr,
                                  DatastoreIdentifier existsTableAlias)
Create a subquery for the given query that selects elements, joining to the owner table. This subquery can subsequently be used in an EXISTS expression to determine whether a Collection is empty.

Parameters:
parentStmt - Parent query statement for this subquery
ownerMapping - Id mapping for the owner
ownerTableExpr - Table Expression for the owner that the subquery joins to
existsTableAlias - Alias for this subquery main table
Returns:
Subquery returning the existence of elements

getSizeSubquery

QueryExpression getSizeSubquery(QueryExpression parentStmt,
                                JavaTypeMapping ownerMapping,
                                LogicSetExpression ownerTableExpr,
                                DatastoreIdentifier sizeTableAlias)
Create a subquery for the size of the collection.

Parameters:
parentStmt - Parent query statement for this subquery
ownerMapping - Id mapping for the owner
ownerTableExpr - Table Expression for the owner in the parent statement that the subquery joins to
sizeTableAlias - Alias for this subquery main table
Returns:
Subquery returning the size

joinElementsTo

ScalarExpression joinElementsTo(QueryExpression stmt,
                                QueryExpression parentStmt,
                                JavaTypeMapping ownerMapping,
                                LogicSetExpression ownerTableExpr,
                                DatastoreIdentifier collectionTableAlias,
                                java.lang.Class filteredElementType,
                                ScalarExpression elementExpr,
                                DatastoreIdentifier elementTableAlias,
                                boolean existsQuery)
Method used in queries when contains() has been invoked.

Parameters:
stmt - The Query Statement
parentStmt - the parent Query Statement. If there is no parent, "parentStmt" must be equals to "stmt".
ownerMapping - the mapping for the owner
ownerTableExpr - Table Expression for the owner
collectionTableAlias - Alias for the "Collection" table.
filteredElementType - The Class Type for the filtered element
elementExpr - The Expression for the element
elementTableAlias - The SQL alias to assign to the element table expression
existsQuery - Whether this is joining for an EXISTS query
Returns:
expression to the join


Copyright © 2010. All Rights Reserved.