org.jpox.store.scostore
Interface ArrayStore

All Superinterfaces:
Store
All Known Implementing Classes:
AbstractArrayStore

public interface ArrayStore
extends Store

Interface representation of the backing store for an array.

Version:
$Revision: 1.4 $

Method Summary
 void clear(StateManager ownerSM)
          Method to clear the array.
 java.util.List getArray(StateManager ownerSM)
          Method to retrieve the elements of the array.
 java.lang.String getElementType()
          Accessor for the element type in the collection.
 QueryExpression getExistsSubquery(QueryExpression stmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTe, DatastoreIdentifier collRangeVar)
          Create a subquery for the given query that joins a SetStore element table to the owner table.
 QueryExpression getSizeSubquery(QueryExpression stmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTe, DatastoreIdentifier collRangeVar)
          Create a subquery for the size of the collection.
 java.util.Iterator iterator(StateManager sm)
          Accessor for an iterator for the array.
 ScalarExpression joinElementsTo(QueryExpression stmt, QueryExpression parentStmt, JavaTypeMapping ownerMapping, LogicSetExpression ownerTe, DatastoreIdentifier collRangeVar, java.lang.Class filteredElementType, ScalarExpression elmExpr, DatastoreIdentifier elementRangeVar)
          Method used in queries when contains() has been invoked.
 boolean set(StateManager ownerSM, java.lang.Object array)
          Method to set the elements in the array.
 int size(StateManager sm)
          Accessor for the size of the array.
 
Methods inherited from interface org.jpox.store.scostore.Store
getOwnerMapping, getStoreManager
 

Method Detail

getElementType

public java.lang.String getElementType()
Accessor for the element type in the collection.

Returns:
The element type.

iterator

public java.util.Iterator iterator(StateManager sm)
Accessor for an iterator for the array.

Parameters:
sm - State Manager for the array.
Returns:
Iterator for the array.

getArray

public java.util.List getArray(StateManager ownerSM)
Method to retrieve the elements of the array.

Parameters:
ownerSM - State Manager of the owner
Returns:
The List of elements in the array (in the same order)

size

public int size(StateManager sm)
Accessor for the size of the array.

Parameters:
sm - State Manager for the owner.
Returns:
The size of the array.

clear

public void clear(StateManager ownerSM)
Method to clear the array.

Parameters:
ownerSM - State Manager for the owner.

set

public boolean set(StateManager ownerSM,
                   java.lang.Object array)
Method to set the elements in the array.

Parameters:
ownerSM - State Manager for the owner.
array - The array
Returns:
Whether the elements were added ok

getExistsSubquery

public QueryExpression getExistsSubquery(QueryExpression stmt,
                                         JavaTypeMapping ownerMapping,
                                         LogicSetExpression ownerTe,
                                         DatastoreIdentifier collRangeVar)
Create a subquery for the given query that joins a SetStore element table to the owner table. This subquery can subsequently be used in an EXISTS expression to determine whether a Collection is empty.

Parameters:
stmt - The Query Statement.
ownerMapping - the mapping for the owner.
ownerTe - Table Expression for the owner
collRangeVar - The range variable for the "Collection" table.
Returns:
A subquery for the given query that joins a SetStore element table to the owner table.

getSizeSubquery

public QueryExpression getSizeSubquery(QueryExpression stmt,
                                       JavaTypeMapping ownerMapping,
                                       LogicSetExpression ownerTe,
                                       DatastoreIdentifier collRangeVar)
Create a subquery for the size of the collection.

Parameters:
stmt - The Query Statement
ownerMapping - Mapping for the owner
ownerTe - Table Expression for the owner
collRangeVar - Range variable for the owner
Returns:
The subquery

joinElementsTo

public ScalarExpression joinElementsTo(QueryExpression stmt,
                                       QueryExpression parentStmt,
                                       JavaTypeMapping ownerMapping,
                                       LogicSetExpression ownerTe,
                                       DatastoreIdentifier collRangeVar,
                                       java.lang.Class filteredElementType,
                                       ScalarExpression elmExpr,
                                       DatastoreIdentifier elementRangeVar)
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.
ownerTe - Table Expression for the owner
collRangeVar - The range variable for the "Collection" table.
filteredElementType - The Class Type for the filtered element
elmExpr - The Expression for the element
elementRangeVar - The SQL alias, or "range variable", to assign to the expression or to the element table.
Returns:
expression to the join


Copyright © -2007 . All Rights Reserved.