org.apache.openjpa.jdbc.meta.strats
Interface LRSMapFieldStrategy

All Superinterfaces:
FieldStrategy, Serializable, Strategy
All Known Implementing Classes:
HandlerHandlerMapTableFieldStrategy, HandlerRelationMapTableFieldStrategy, MapTableFieldStrategy, RelationHandlerMapTableFieldStrategy, RelationMapInverseKeyFieldStrategy, RelationMapTableFieldStrategy, RelationRelationMapTableFieldStrategy

public interface LRSMapFieldStrategy
extends FieldStrategy

Interface implemented by map strategies so that they can support large result set maps.

Author:
Abe White

Method Summary
 Object deriveKey(JDBCStore store, Object value)
          Some mapping derive keys from map values.
 Object deriveValue(JDBCStore store, Object key)
          Some mapping derive values from map keys.
 FieldMapping getFieldMapping()
          The owning field mapping.
 ClassMapping[] getIndependentKeyMappings(boolean traverse)
          Return all independent mappings to which this strategy must join in order to access map keys, or empty array if none.
 ClassMapping[] getIndependentValueMappings(boolean traverse)
          Return all independent mappings to which this strategy must join in order to access map values, or empty array if none.
 ForeignKey getJoinForeignKey(ClassMapping cls)
          Return the foreign key used to join to the owning field for the given mapping from either getIndependentKeyMappings(boolean) or getIndependentValueMappings(boolean) (or null).
 Column[] getKeyColumns(ClassMapping cls)
          Return the columns holding data for a map key for the given key mapping from getIndependentKeyMappings(boolean) or getIndependentValueMappings(boolean) (or null).
 Result[] getResults(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode, Joins[] joins, boolean lrs)
          Return results containing all keys and values for this map.
 Column[] getValueColumns(ClassMapping cls)
          Return the columns holding data for a map value for the given value mapping from getIndependentKeyMappings(boolean) or getIndependentValueMappings(boolean) (or null).
 Joins joinKeyRelation(Joins joins, ClassMapping key)
          Join this value's table to the table for the given key mapping from getIndependentKeyMappings(boolean) (or null).
 Joins joinValueRelation(Joins joins, ClassMapping val)
          Join this value's table to the table for the given value mapping from getIndependentValueMappings(boolean) (or null).
 Object loadKey(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins)
          Load a key from the given result.
 Object loadValue(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins)
          Load a value from the given result.
 void selectKey(Select sel, ClassMapping key, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins)
          Implement this method to select the keys of this field.
 void selectValue(Select sel, ClassMapping val, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins)
          Implement this method to select the values of this field.
 
Methods inherited from interface org.apache.openjpa.jdbc.meta.FieldStrategy
appendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendSize, appendType, isEagerSelectToMany, isVersionable, join, joinKey, joinKeyRelation, joinRelation, load, load, loadEagerJoin, loadEagerParallel, loadKeyProjection, loadProjection, select, selectEagerJoin, selectEagerParallel, setFieldMapping, supportsSelect, toDataStoreValue, toKeyDataStoreValue, where
 
Methods inherited from interface org.apache.openjpa.jdbc.meta.Strategy
customDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, update
 

Method Detail

getFieldMapping

FieldMapping getFieldMapping()
The owning field mapping.


getIndependentKeyMappings

ClassMapping[] getIndependentKeyMappings(boolean traverse)
Return all independent mappings to which this strategy must join in order to access map keys, or empty array if none.

See Also:
ValueMapping.getIndependentTypeMappings(), ClassMapping.EMPTY_MAPPINGS

getIndependentValueMappings

ClassMapping[] getIndependentValueMappings(boolean traverse)
Return all independent mappings to which this strategy must join in order to access map values, or empty array if none.

See Also:
ValueMapping.getIndependentTypeMappings(), ClassMapping.EMPTY_MAPPINGS

getJoinForeignKey

ForeignKey getJoinForeignKey(ClassMapping cls)
Return the foreign key used to join to the owning field for the given mapping from either getIndependentKeyMappings(boolean) or getIndependentValueMappings(boolean) (or null).


getKeyColumns

Column[] getKeyColumns(ClassMapping cls)
Return the columns holding data for a map key for the given key mapping from getIndependentKeyMappings(boolean) or getIndependentValueMappings(boolean) (or null).


getValueColumns

Column[] getValueColumns(ClassMapping cls)
Return the columns holding data for a map value for the given value mapping from getIndependentKeyMappings(boolean) or getIndependentValueMappings(boolean) (or null).


selectKey

void selectKey(Select sel,
               ClassMapping key,
               OpenJPAStateManager sm,
               JDBCStore store,
               JDBCFetchConfiguration fetch,
               Joins joins)
Implement this method to select the keys of this field. Elements of the result will be loaded with loadKey(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration, org.apache.openjpa.jdbc.sql.Result, org.apache.openjpa.jdbc.sql.Joins). This method is only used if the key is not derived from the value.


loadKey

Object loadKey(OpenJPAStateManager sm,
               JDBCStore store,
               JDBCFetchConfiguration fetch,
               Result res,
               Joins joins)
               throws SQLException
Load a key from the given result. This method is only used if the key is not derived from the value.

Throws:
SQLException

deriveKey

Object deriveKey(JDBCStore store,
                 Object value)
Some mapping derive keys from map values. Other mappings may return null.


deriveValue

Object deriveValue(JDBCStore store,
                   Object key)
Some mapping derive values from map keys. Other mappings may return null.


selectValue

void selectValue(Select sel,
                 ClassMapping val,
                 OpenJPAStateManager sm,
                 JDBCStore store,
                 JDBCFetchConfiguration fetch,
                 Joins joins)
Implement this method to select the values of this field. Elements of the result will be loaded with loadValue(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration, org.apache.openjpa.jdbc.sql.Result, org.apache.openjpa.jdbc.sql.Joins).


loadValue

Object loadValue(OpenJPAStateManager sm,
                 JDBCStore store,
                 JDBCFetchConfiguration fetch,
                 Result res,
                 Joins joins)
                 throws SQLException
Load a value from the given result.

Throws:
SQLException

getResults

Result[] getResults(OpenJPAStateManager sm,
                    JDBCStore store,
                    JDBCFetchConfiguration fetch,
                    int eagerMode,
                    Joins[] joins,
                    boolean lrs)
                    throws SQLException
Return results containing all keys and values for this map. If only one result is needed, set both array indexes to the same result instance. Also fill in the key and value joins in the given array. The results will be loaded with the loadKey(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration, org.apache.openjpa.jdbc.sql.Result, org.apache.openjpa.jdbc.sql.Joins) or deriveKey(org.apache.openjpa.jdbc.kernel.JDBCStore, java.lang.Object) and loadValue(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration, org.apache.openjpa.jdbc.sql.Result, org.apache.openjpa.jdbc.sql.Joins) methods.

Throws:
SQLException

joinKeyRelation

Joins joinKeyRelation(Joins joins,
                      ClassMapping key)
Join this value's table to the table for the given key mapping from getIndependentKeyMappings(boolean) (or null).


joinValueRelation

Joins joinValueRelation(Joins joins,
                        ClassMapping val)
Join this value's table to the table for the given value mapping from getIndependentValueMappings(boolean) (or null).



Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.