org.datanucleus.store.mapped.expression
Interface MapStoreQueryable

All Known Implementing Classes:
AbstractMapStore, FKMapStore, JoinMapStore

public interface MapStoreQueryable

Interface representation of the querying capabilities of a backing store for a map. 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 stmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTe, DatastoreIdentifier mapRangeVar)
          Create a subquery for the given query that joins a MapStore value table to the owner table.
 QueryExpression getSizeSubquery(QueryExpression stmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTe, DatastoreIdentifier mapRangeVar)
          Create a subquery for the size of the map.
 ScalarExpression joinKeysTo(QueryExpression stmt, QueryExpression parentStmt, JavaTypeMapping ownerMapping, LogicSetExpression te, DatastoreIdentifier mapRangeVar, java.lang.Class filteredKeyType, ScalarExpression keyExpr, DatastoreIdentifier keyRangeVar)
          Utility to create a join for keys to be used in a containsKey() query.
 ScalarExpression[] joinKeysToGet(QueryExpression stmt, QueryExpression parentStmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTe, DatastoreIdentifier mapRangeVar, java.lang.Class filteredKeyType, DatastoreIdentifier keyRangeVar, DatastoreIdentifier valueRangeVar)
          Used as part of the Querying of Maps where a get(Key) is used.
 ScalarExpression[] joinKeysValuesTo(QueryExpression stmt, QueryExpression parentStmt, JavaTypeMapping ownerMapping, LogicSetExpression te, DatastoreIdentifier mapRangeVar, java.lang.Class filteredKeyType, java.lang.Class filteredValueType, ScalarExpression keyExpr, ScalarExpression valExpr, DatastoreIdentifier keyRangeVar, DatastoreIdentifier valueRangeVar)
          Utility to create a join for keys and values to be used in ai containsEntry() query.
 ScalarExpression joinValuesTo(QueryExpression stmt, QueryExpression parentStmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTe, DatastoreIdentifier mapRangeVar, java.lang.Class filteredValueType, ScalarExpression valExpr, DatastoreIdentifier valueRangeVar)
          Used as part of the Querying of Maps where a containsValue() is used.
 

Method Detail

getExistsSubquery

QueryExpression getExistsSubquery(QueryExpression stmt,
                                  JavaTypeMapping ownerMapping,
                                  LogicSetExpression ownerTe,
                                  DatastoreIdentifier mapRangeVar)
Create a subquery for the given query that joins a MapStore value table to the owner table. This subquery can subsequently be used in an EXISTS expression to determine whether a Map is empty or not.

Parameters:
stmt - The parent query statement that will use this as a subquery
ownerMapping - the mapping for the owner
ownerTe - Table Expression for the owner that the subquery joins to
mapRangeVar - The range variable for the "Map" table.
Returns:
A subquery for the given query that joins a MapStore value table to the owner table.

getSizeSubquery

QueryExpression getSizeSubquery(QueryExpression stmt,
                                JavaTypeMapping ownerMapping,
                                LogicSetExpression ownerTe,
                                DatastoreIdentifier mapRangeVar)
Create a subquery for the size of the map.

Parameters:
stmt - The parent query statement that will use this as a subquery
ownerMapping - the mapping for the owner
ownerTe - Table Expression for the owner that the subquery joins to
mapRangeVar - Range variable for this subquery main table
Returns:
A subquery for the size.

joinKeysValuesTo

ScalarExpression[] joinKeysValuesTo(QueryExpression stmt,
                                    QueryExpression parentStmt,
                                    JavaTypeMapping ownerMapping,
                                    LogicSetExpression te,
                                    DatastoreIdentifier mapRangeVar,
                                    java.lang.Class filteredKeyType,
                                    java.lang.Class filteredValueType,
                                    ScalarExpression keyExpr,
                                    ScalarExpression valExpr,
                                    DatastoreIdentifier keyRangeVar,
                                    DatastoreIdentifier valueRangeVar)
Utility to create a join for keys and values to be used in ai containsEntry() query.

Parameters:
stmt - The Query Statement to apply the join
parentStmt - the parent Query Statement. If there is no parent, parentStmt must be equals to stmt
ownerMapping - Mapping for the owner
te - Table Expression for the owner
mapRangeVar - The SQL alias, or "range variable", to assign to the expression or to the main table.
filteredKeyType - The Class Type for the filtered key
filteredValueType - The Class Type for the filtered value
keyExpr - the expression to the key field
valExpr - Table Expression for the value
keyRangeVar - The SQL alias, or "range variable", to assign to the expression or to the key table.
valueRangeVar - The SQL alias, or "range variable", to assign to the expression or to the value table.
Returns:
an array with 2 elements of QueryColumnList. The first element contains the columns from the key mapping and the second element the columns from the value mapping

joinKeysTo

ScalarExpression joinKeysTo(QueryExpression stmt,
                            QueryExpression parentStmt,
                            JavaTypeMapping ownerMapping,
                            LogicSetExpression te,
                            DatastoreIdentifier mapRangeVar,
                            java.lang.Class filteredKeyType,
                            ScalarExpression keyExpr,
                            DatastoreIdentifier keyRangeVar)
Utility to create a join for keys to be used in a containsKey() query.

Parameters:
stmt - The Query Statement
parentStmt - the parent Query Statement. If there is no parent, parentStmt must be equals to stmt
ownerMapping - Mapping for the owner
te - Table Expression for the owner
mapRangeVar - The range variable for the "Map" table.
filteredKeyType - The Class Type for the filtered key
keyExpr - the expression to the key field. if not provided, obtain the expression of the ID of the table where filteredKeyType is stored
keyRangeVar - The SQL alias, or "range variable", to assign to the expression or to the key table.
Returns:
QueryColumnList with the columns from the key mapping

joinValuesTo

ScalarExpression joinValuesTo(QueryExpression stmt,
                              QueryExpression parentStmt,
                              JavaTypeMapping ownerMapping,
                              LogicSetExpression ownerTe,
                              DatastoreIdentifier mapRangeVar,
                              java.lang.Class filteredValueType,
                              ScalarExpression valExpr,
                              DatastoreIdentifier valueRangeVar)
Used as part of the Querying of Maps where a containsValue() is used.

Parameters:
stmt - The Query Statement
parentStmt - the parent Query Statement. If there is no parent, parentStmt must be equals to stmt
ownerMapping - Mapping for the owner
ownerTe - Table Expression for the owner
mapRangeVar - The range variable for the "Map" table.
filteredValueType - The Class Type for the filtered value
valExpr - the expression to the value field. if not provided, obtain the expression of the ID of the table where filteredValueType is stored
valueRangeVar - The SQL alias, or "range variable", to assign to the expression or to the value table.
Returns:
QueryColumnList with the columns from the value mapping

joinKeysToGet

ScalarExpression[] joinKeysToGet(QueryExpression stmt,
                                 QueryExpression parentStmt,
                                 JavaTypeMapping ownerMapping,
                                 LogicSetExpression ownerTe,
                                 DatastoreIdentifier mapRangeVar,
                                 java.lang.Class filteredKeyType,
                                 DatastoreIdentifier keyRangeVar,
                                 DatastoreIdentifier valueRangeVar)
Used as part of the Querying of Maps where a get(Key) is used.

Parameters:
stmt - The Query Statement to apply the join
parentStmt - the parent Query Statement. If there is no parent, parentStmt must be equals to stmt
ownerMapping - Mapping for the owner
ownerTe - Table Expression for the owner
mapRangeVar - The SQL alias, or "range variable", to assign to the expression or to the main table.
filteredKeyType - The Class Type for the filtered key
keyRangeVar - The SQL alias, or "range variable", to assign to the expression or to the key table.
valueRangeVar - The SQL alias, or "range variable", to assign to the expression or to the value table.
Returns:
an array with 2 elements of QueryColumnList. The first element contains the columns from the key mapping and the second element the columns from the value mapping


Copyright © 2010. All Rights Reserved.