public class RelationMapTableFieldStrategy extends RelationToManyTableFieldStrategy implements LRSMapFieldStrategy
field| Constructor and Description |
|---|
RelationMapTableFieldStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
add(JDBCStore store,
Object coll,
Object obj)
Add an item to the data structure representing a field value.
|
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
element mapping from
ContainerFieldStrategy.getIndependentElementMappings(boolean) (or null). |
Column[] |
getKeyColumns(ClassMapping cls)
Return the columns holding data for a map key for the given key mapping
from
LRSMapFieldStrategy.getIndependentKeyMappings(boolean) or
LRSMapFieldStrategy.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
LRSMapFieldStrategy.getIndependentKeyMappings(boolean) or
LRSMapFieldStrategy.getIndependentValueMappings(boolean) (or null). |
Joins |
joinKey(Joins joins,
boolean forceOuter)
Join the key value to the class table.
|
Joins |
joinKeyRelation(Joins joins,
boolean forceOuter,
boolean traverse)
Join this value's table to the table for the related first class object
key type, if any.
|
Joins |
joinKeyRelation(Joins joins,
ClassMapping key)
Join this value's table to the table for the given key mapping
from
LRSMapFieldStrategy.getIndependentKeyMappings(boolean) (or null). |
Joins |
joinValueRelation(Joins joins,
ClassMapping val)
Join this value's table to the table for the given value mapping
from
LRSMapFieldStrategy.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 |
map(boolean adapt)
Map the owning mapping using this strategy.
|
protected Proxy |
newLRSProxy()
Return a large result set proxy for this field.
|
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.
|
protected Collection |
toCollection(Object val)
Convert the field value to a collection.
|
delete, getIndependentElementMappings, insert, join, join, joinElementRelation, joinRelation, loadElement, selectElement, toDataStoreValue, updategetJoinForeignKey, isEagerSelectToMany, load, loadEagerJoin, loadEagerParallel, loadProjection, selectAll, selectEagerJoin, selectEagerParallel, supportsSelectappendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendJoinCount, appendSize, appendUnaliasedJoinappendType, assertNotMappedBy, isVersionable, load, loadKeyProjection, select, setFieldMapping, toKeyDataStoreValue, wherecustomDelete, customInsert, customUpdate, getAlias, initialize, isCustomDelete, isCustomInsert, isCustomUpdateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendSize, appendType, isEagerSelectToMany, isVersionable, join, joinRelation, load, load, loadEagerJoin, loadEagerParallel, loadKeyProjection, loadProjection, select, selectEagerJoin, selectEagerParallel, setFieldMapping, supportsSelect, toDataStoreValue, toKeyDataStoreValue, wherecustomDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, updatepublic FieldMapping getFieldMapping()
LRSMapFieldStrategygetFieldMapping in interface LRSMapFieldStrategypublic ClassMapping[] getIndependentKeyMappings(boolean traverse)
LRSMapFieldStrategygetIndependentKeyMappings in interface LRSMapFieldStrategyValueMapping.getIndependentTypeMappings(),
ClassMapping.EMPTY_MAPPINGSpublic ClassMapping[] getIndependentValueMappings(boolean traverse)
LRSMapFieldStrategygetIndependentValueMappings in interface LRSMapFieldStrategyValueMapping.getIndependentTypeMappings(),
ClassMapping.EMPTY_MAPPINGSpublic ForeignKey getJoinForeignKey(ClassMapping cls)
StoreCollectionFieldStrategyContainerFieldStrategy.getIndependentElementMappings(boolean) (or null).getJoinForeignKey in interface LRSMapFieldStrategygetJoinForeignKey in class RelationToManyTableFieldStrategypublic Column[] getKeyColumns(ClassMapping cls)
LRSMapFieldStrategyLRSMapFieldStrategy.getIndependentKeyMappings(boolean) or
LRSMapFieldStrategy.getIndependentValueMappings(boolean) (or null).getKeyColumns in interface LRSMapFieldStrategypublic Column[] getValueColumns(ClassMapping cls)
LRSMapFieldStrategyLRSMapFieldStrategy.getIndependentKeyMappings(boolean) or
LRSMapFieldStrategy.getIndependentValueMappings(boolean) (or null).getValueColumns in interface LRSMapFieldStrategypublic void selectKey(Select sel, ClassMapping key, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins)
LRSMapFieldStrategyLRSMapFieldStrategy.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.selectKey in interface LRSMapFieldStrategypublic Object loadKey(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
LRSMapFieldStrategyloadKey in interface LRSMapFieldStrategySQLExceptionpublic Object deriveKey(JDBCStore store, Object value)
LRSMapFieldStrategyderiveKey in interface LRSMapFieldStrategypublic Object deriveValue(JDBCStore store, Object key)
LRSMapFieldStrategyderiveValue in interface LRSMapFieldStrategypublic void selectValue(Select sel, ClassMapping val, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins)
LRSMapFieldStrategyLRSMapFieldStrategy.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).selectValue in interface LRSMapFieldStrategypublic Object loadValue(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
LRSMapFieldStrategyloadValue in interface LRSMapFieldStrategySQLExceptionpublic Result[] getResults(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode, Joins[] joins, boolean lrs) throws SQLException
LRSMapFieldStrategyLRSMapFieldStrategy.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
LRSMapFieldStrategy.deriveKey(org.apache.openjpa.jdbc.kernel.JDBCStore, java.lang.Object) and LRSMapFieldStrategy.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.getResults in interface LRSMapFieldStrategySQLExceptionpublic Joins joinKeyRelation(Joins joins, ClassMapping key)
LRSMapFieldStrategyLRSMapFieldStrategy.getIndependentKeyMappings(boolean) (or null).joinKeyRelation in interface LRSMapFieldStrategypublic Joins joinKeyRelation(Joins joins, boolean forceOuter, boolean traverse)
FieldStrategyjoinKeyRelation in interface FieldStrategyjoinKeyRelation in class AbstractFieldStrategytraverse - if true, throw proper exception if it is not
possible for this mapping to traverse into the related typepublic Joins joinValueRelation(Joins joins, ClassMapping val)
LRSMapFieldStrategyLRSMapFieldStrategy.getIndependentValueMappings(boolean) (or null).joinValueRelation in interface LRSMapFieldStrategyprotected Proxy newLRSProxy()
StoreCollectionFieldStrategynewLRSProxy in class StoreCollectionFieldStrategyprotected void add(JDBCStore store, Object coll, Object obj)
StoreCollectionFieldStrategyadd in class StoreCollectionFieldStrategyprotected Collection toCollection(Object val)
StoreCollectionFieldStrategytoCollection in class StoreCollectionFieldStrategypublic void map(boolean adapt)
Strategymap in interface Strategymap in class RelationToManyTableFieldStrategyadapt - if true, use the owning mapping's raw mapping info
to set its ORM data; if false, ORM data will already be setpublic Joins joinKey(Joins joins, boolean forceOuter)
FieldStrategyjoinKey in interface FieldStrategyjoinKey in class AbstractFieldStrategyCopyright © 2006–2022 Apache Software Foundation. All rights reserved.