public abstract class MapTableFieldStrategy extends ContainerFieldStrategy implements LRSMapFieldStrategy
FieldStrategy.toDataStoreValue(java.lang.Object, org.apache.openjpa.jdbc.kernel.JDBCStore),
FieldStrategy.toKeyDataStoreValue(java.lang.Object, org.apache.openjpa.jdbc.kernel.JDBCStore),
FieldStrategy.joinRelation(org.apache.openjpa.jdbc.sql.Joins, boolean, boolean), and
FieldStrategy.joinKeyRelation(org.apache.openjpa.jdbc.sql.Joins, boolean, boolean) if necessary.field| Constructor and Description |
|---|
MapTableFieldStrategy() |
| 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.
|
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.
|
protected ClassMapping[] |
getIndependentElementMappings(boolean traverse)
Return all independent mappings to which this strategy must join in
order to access collection elements, or empty array if none.
|
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() |
ForeignKey |
getJoinForeignKey(ClassMapping cls)
Return the foreign key used to join to the owning field for the given
mapping from either
LRSMapFieldStrategy.getIndependentKeyMappings(boolean) or
LRSMapFieldStrategy.getIndependentValueMappings(boolean) (or null). |
protected void |
handleMappedByForeignKey(boolean adapt) |
protected boolean |
isTypeUnjoinedSubclass(ValueMapping mapped) |
Joins |
join(Joins joins,
boolean forceOuter)
Join this value to the class table.
|
Joins |
joinKey(Joins joins,
boolean forceOuter)
Join the key value to the class table.
|
Joins |
joinKeyRelation(Joins joins,
ClassMapping key)
|
Joins |
joinValueRelation(Joins joins,
ClassMapping val)
Invokes
FieldStrategy.joinRelation(org.apache.openjpa.jdbc.sql.Joins, boolean, boolean) by default. |
void |
load(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch)
Load secondary data using a connection from the store manager.
|
Object |
loadKeyProjection(JDBCStore store,
JDBCFetchConfiguration fetch,
Result res,
Joins joins)
Load this field's key value using the given result.
|
Object |
loadProjection(JDBCStore store,
JDBCFetchConfiguration fetch,
Result res,
Joins joins)
Load this field value using the given result.
|
void |
map(boolean adapt)
Map the owning mapping using this strategy.
|
protected boolean |
populateKey(Row row,
OpenJPAStateManager valsm,
Object obj,
StoreContext ctx,
RowManager rm,
JDBCStore store) |
int |
supportsSelect(Select sel,
int type,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch)
Return whether this mapping can perform the given select type.
|
appendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendJoinCount, appendSize, appendUnaliasedJoinappendType, assertNotMappedBy, isEagerSelectToMany, isVersionable, joinKeyRelation, joinRelation, load, loadEagerJoin, loadEagerParallel, select, selectEagerJoin, selectEagerParallel, setFieldMapping, toDataStoreValue, toKeyDataStoreValue, wherecustomDelete, customInsert, customUpdate, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetKeyColumns, getResults, getValueColumns, loadKey, loadValue, selectKey, selectValueappendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendSize, appendType, isEagerSelectToMany, isVersionable, joinKeyRelation, joinRelation, load, loadEagerJoin, loadEagerParallel, select, selectEagerJoin, selectEagerParallel, setFieldMapping, toDataStoreValue, toKeyDataStoreValue, wherecustomDelete, customInsert, customUpdate, 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)
LRSMapFieldStrategyLRSMapFieldStrategy.getIndependentKeyMappings(boolean) or
LRSMapFieldStrategy.getIndependentValueMappings(boolean) (or null).getJoinForeignKey in interface LRSMapFieldStrategypublic Object deriveKey(JDBCStore store, Object value)
LRSMapFieldStrategyderiveKey in interface LRSMapFieldStrategypublic Object deriveValue(JDBCStore store, Object key)
LRSMapFieldStrategyderiveValue in interface LRSMapFieldStrategypublic Joins joinKeyRelation(Joins joins, ClassMapping key)
FieldStrategy.joinKeyRelation(org.apache.openjpa.jdbc.sql.Joins, boolean, boolean) by default.joinKeyRelation in interface LRSMapFieldStrategypublic Joins joinValueRelation(Joins joins, ClassMapping val)
FieldStrategy.joinRelation(org.apache.openjpa.jdbc.sql.Joins, boolean, boolean) by default.joinValueRelation in interface LRSMapFieldStrategypublic void map(boolean adapt)
Strategymap in interface Strategymap in class AbstractStrategyadapt - if true, use the owning mapping's raw mapping info
to set its ORM data; if false, ORM data will already be setpublic void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategydelete in interface Strategydelete in class AbstractStrategySQLExceptionStrategy.insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)public int supportsSelect(Select sel, int type, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch)
FieldStrategysupportsSelect in interface FieldStrategysupportsSelect in class AbstractFieldStrategySelectpublic void load(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch) throws SQLException
FieldStrategyload in interface FieldStrategyload in class AbstractFieldStrategySQLExceptionpublic Object loadKeyProjection(JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
FieldStrategyValueMapping.getColumns().loadKeyProjection in interface FieldStrategyloadKeyProjection in class AbstractFieldStrategySQLExceptionpublic Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
FieldStrategyValueMapping.getColumns().loadProjection in interface FieldStrategyloadProjection in class AbstractFieldStrategySQLExceptionpublic Joins join(Joins joins, boolean forceOuter)
FieldStrategyjoin in interface FieldStrategyjoin in class AbstractFieldStrategypublic Joins joinKey(Joins joins, boolean forceOuter)
FieldStrategyjoinKey in interface FieldStrategyjoinKey in class AbstractFieldStrategypublic ForeignKey getJoinForeignKey()
getJoinForeignKey in class ContainerFieldStrategyprotected ClassMapping[] getIndependentElementMappings(boolean traverse)
ContainerFieldStrategygetIndependentElementMappings in class ContainerFieldStrategytraverse - whether we're traversing through to the related typeValueMapping.getIndependentTypeMappings(),
ClassMapping.EMPTY_MAPPINGSprotected void handleMappedByForeignKey(boolean adapt)
protected boolean isTypeUnjoinedSubclass(ValueMapping mapped)
protected boolean populateKey(Row row, OpenJPAStateManager valsm, Object obj, StoreContext ctx, RowManager rm, JDBCStore store) throws SQLException
SQLExceptionCopyright © 2006–2018 Apache Software Foundation. All rights reserved.