Interface LRSMapFieldStrategy
-
- All Superinterfaces:
FieldStrategy
,java.io.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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
deriveKey(JDBCStore store, java.lang.Object value)
Some mapping derive keys from map values.java.lang.Object
deriveValue(JDBCStore store, java.lang.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 eithergetIndependentKeyMappings(boolean)
orgetIndependentValueMappings(boolean)
(or null).Column[]
getKeyColumns(ClassMapping cls)
Return the columns holding data for a map key for the given key mapping fromgetIndependentKeyMappings(boolean)
orgetIndependentValueMappings(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 fromgetIndependentKeyMappings(boolean)
orgetIndependentValueMappings(boolean)
(or null).Joins
joinKeyRelation(Joins joins, ClassMapping key)
Join this value's table to the table for the given key mapping fromgetIndependentKeyMappings(boolean)
(or null).Joins
joinValueRelation(Joins joins, ClassMapping val)
Join this value's table to the table for the given value mapping fromgetIndependentValueMappings(boolean)
(or null).java.lang.Object
loadKey(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins)
Load a key from the given result.java.lang.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.
-
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.
-
getJoinForeignKey
ForeignKey getJoinForeignKey(ClassMapping cls)
Return the foreign key used to join to the owning field for the given mapping from eithergetIndependentKeyMappings(boolean)
orgetIndependentValueMappings(boolean)
(or null).
-
getKeyColumns
Column[] getKeyColumns(ClassMapping cls)
Return the columns holding data for a map key for the given key mapping fromgetIndependentKeyMappings(boolean)
orgetIndependentValueMappings(boolean)
(or null).
-
getValueColumns
Column[] getValueColumns(ClassMapping cls)
Return the columns holding data for a map value for the given value mapping fromgetIndependentKeyMappings(boolean)
orgetIndependentValueMappings(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 withloadKey(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
java.lang.Object loadKey(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws java.sql.SQLException
Load a key from the given result. This method is only used if the key is not derived from the value.- Throws:
java.sql.SQLException
-
deriveKey
java.lang.Object deriveKey(JDBCStore store, java.lang.Object value)
Some mapping derive keys from map values. Other mappings may return null.
-
deriveValue
java.lang.Object deriveValue(JDBCStore store, java.lang.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 withloadValue(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
java.lang.Object loadValue(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws java.sql.SQLException
Load a value from the given result.- Throws:
java.sql.SQLException
-
getResults
Result[] getResults(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode, Joins[] joins, boolean lrs) throws java.sql.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 theloadKey(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)
orderiveKey(org.apache.openjpa.jdbc.kernel.JDBCStore, java.lang.Object)
andloadValue(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:
java.sql.SQLException
-
joinKeyRelation
Joins joinKeyRelation(Joins joins, ClassMapping key)
Join this value's table to the table for the given key mapping fromgetIndependentKeyMappings(boolean)
(or null).
-
joinValueRelation
Joins joinValueRelation(Joins joins, ClassMapping val)
Join this value's table to the table for the given value mapping fromgetIndependentValueMappings(boolean)
(or null).
-
-