Interface LRSMapFieldStrategy
- All Superinterfaces:
FieldStrategy
,Serializable
,Strategy
- All Known Implementing Classes:
HandlerHandlerMapTableFieldStrategy
,HandlerRelationMapTableFieldStrategy
,MapTableFieldStrategy
,RelationHandlerMapTableFieldStrategy
,RelationMapInverseKeyFieldStrategy
,RelationMapTableFieldStrategy
,RelationRelationMapTableFieldStrategy
Interface implemented by map strategies so that they can
support large result set maps.
- Author:
- Abe White
-
Method Summary
Modifier and TypeMethodDescriptionSome mapping derive keys from map values.deriveValue
(JDBCStore store, Object key) Some mapping derive values from map keys.The owning field mapping.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
(boolean traverse) Return all independent mappings to which this strategy must join in order to access map values, or empty array if none.Return the foreign key used to join to the owning field for the given mapping from eithergetIndependentKeyMappings(boolean)
orgetIndependentValueMappings(boolean)
(or null).Column[]
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[]
Return the columns holding data for a map value for the given value mapping fromgetIndependentKeyMappings(boolean)
orgetIndependentValueMappings(boolean)
(or null).joinKeyRelation
(Joins joins, ClassMapping key) Join this value's table to the table for the given key mapping fromgetIndependentKeyMappings(boolean)
(or null).joinValueRelation
(Joins joins, ClassMapping val) Join this value's table to the table for the given value mapping fromgetIndependentValueMappings(boolean)
(or null).loadKey
(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) Load a key from the given result.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 Details
-
getFieldMapping
FieldMapping getFieldMapping()The owning field mapping. -
getIndependentKeyMappings
Return all independent mappings to which this strategy must join in order to access map keys, or empty array if none. -
getIndependentValueMappings
Return all independent mappings to which this strategy must join in order to access map values, or empty array if none. -
getJoinForeignKey
Return the foreign key used to join to the owning field for the given mapping from eithergetIndependentKeyMappings(boolean)
orgetIndependentValueMappings(boolean)
(or null). -
getKeyColumns
Return the columns holding data for a map key for the given key mapping fromgetIndependentKeyMappings(boolean)
orgetIndependentValueMappings(boolean)
(or null). -
getValueColumns
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
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
Some mapping derive keys from map values. Other mappings may return null. -
deriveValue
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
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 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:
SQLException
-
joinKeyRelation
Join this value's table to the table for the given key mapping fromgetIndependentKeyMappings(boolean)
(or null). -
joinValueRelation
Join this value's table to the table for the given value mapping fromgetIndependentValueMappings(boolean)
(or null).
-