public class HandlerRelationMapTableFieldStrategy extends MapTableFieldStrategy
Mapping for a map whose keys are controlled by a ValueHandler
and whose values are relations to other persistent objects.
field| Constructor and Description |
|---|
HandlerRelationMapTableFieldStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
Set the where values appropriately to delete the proper instance,
and set all relations on non-secondary tables as updates.
|
ColumnIO |
getKeyColumnIO() |
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[] resJoins,
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). |
void |
initialize()
Perform caching and other initialization operations.
|
void |
insert(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
Set values for the mapping into the proper rows.
|
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 |
joinRelation(Joins joins,
boolean forceOuter,
boolean traverse)
Join this value's table to the table for the related first class object
type, if any.
|
Joins |
joinValueRelation(Joins joins,
ClassMapping val)
Invokes
FieldStrategy.joinRelation(org.apache.openjpa.jdbc.sql.Joins, boolean, boolean) by default. |
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.
|
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.
|
void |
setKey(Object keyObj,
JDBCStore store,
Row row) |
Object |
toDataStoreValue(Object val,
JDBCStore store)
Translate the given external field value to its datastore equivalent.
|
Object |
toKeyDataStoreValue(Object val,
JDBCStore store)
Translate the given key value to its datastore equivalent.
|
void |
update(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
Set values for the mapping into the proper rows.
|
deriveKey, deriveValue, getFieldMapping, getIndependentElementMappings, getIndependentKeyMappings, getIndependentValueMappings, getJoinForeignKey, getJoinForeignKey, handleMappedByForeignKey, isTypeUnjoinedSubclass, join, joinKey, joinKeyRelation, load, loadKeyProjection, loadProjection, populateKey, supportsSelectappendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendJoinCount, appendSize, appendUnaliasedJoinappendType, assertNotMappedBy, isEagerSelectToMany, isVersionable, load, loadEagerJoin, loadEagerParallel, select, selectEagerJoin, selectEagerParallel, setFieldMapping, wherecustomDelete, customInsert, customUpdate, getAlias, isCustomDelete, isCustomInsert, isCustomUpdateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendSize, appendType, isEagerSelectToMany, isVersionable, load, loadEagerJoin, loadEagerParallel, select, selectEagerJoin, selectEagerParallel, setFieldMapping, wherecustomDelete, customInsert, customUpdate, getAlias, isCustomDelete, isCustomInsert, isCustomUpdatepublic HandlerRelationMapTableFieldStrategy()
public Column[] getKeyColumns(ClassMapping cls)
LRSMapFieldStrategyLRSMapFieldStrategy.getIndependentKeyMappings(boolean) or
LRSMapFieldStrategy.getIndependentValueMappings(boolean) (or null).public ColumnIO getKeyColumnIO()
public Column[] getValueColumns(ClassMapping cls)
LRSMapFieldStrategyLRSMapFieldStrategy.getIndependentKeyMappings(boolean) or
LRSMapFieldStrategy.getIndependentValueMappings(boolean) (or null).public 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.public 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).public Result[] getResults(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode, Joins[] resJoins, 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.SQLExceptionpublic Object loadKey(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
LRSMapFieldStrategySQLExceptionpublic Object loadValue(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
LRSMapFieldStrategySQLExceptionpublic Joins joinValueRelation(Joins joins, ClassMapping val)
MapTableFieldStrategyFieldStrategy.joinRelation(org.apache.openjpa.jdbc.sql.Joins, boolean, boolean) by default.joinValueRelation in interface LRSMapFieldStrategyjoinValueRelation in class MapTableFieldStrategypublic void map(boolean adapt)
Strategymap in interface Strategymap in class MapTableFieldStrategyadapt - if true, use the owning mapping's raw mapping info
to set its ORM data; if false, ORM data will already be setpublic void initialize()
StrategyStrategy.map(boolean), and after all related components have been
mapped as well.initialize in interface Strategyinitialize in class AbstractStrategypublic void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategyinsert in interface Strategyinsert in class AbstractStrategySQLExceptionpublic void setKey(Object keyObj, JDBCStore store, Row row) throws SQLException
SQLExceptionpublic void update(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategyupdate in interface Strategyupdate in class AbstractStrategySQLExceptionStrategy.insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)public Joins joinRelation(Joins joins, boolean forceOuter, boolean traverse)
FieldStrategyjoinRelation in interface FieldStrategyjoinRelation in class AbstractFieldStrategytraverse - if true, throw proper exception if it is not
possible for this mapping to traverse into the related typepublic 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 Object toDataStoreValue(Object val, JDBCStore store)
FieldStrategytoDataStoreValue in interface FieldStrategytoDataStoreValue in class AbstractFieldStrategypublic Object toKeyDataStoreValue(Object val, JDBCStore store)
FieldStrategytoKeyDataStoreValue in interface FieldStrategytoKeyDataStoreValue in class AbstractFieldStrategypublic void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategydelete in interface Strategydelete in class MapTableFieldStrategySQLExceptionStrategy.insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)Copyright © 2006–2022 Apache Software Foundation. All rights reserved.