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, supportsSelect
appendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendJoinCount, appendSize, appendUnaliasedJoin
appendType, assertNotMappedBy, isEagerSelectToMany, isVersionable, load, loadEagerJoin, loadEagerParallel, select, selectEagerJoin, selectEagerParallel, setFieldMapping, where
customDelete, customInsert, customUpdate, getAlias, isCustomDelete, isCustomInsert, isCustomUpdate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
appendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendSize, appendType, isEagerSelectToMany, isVersionable, load, loadEagerJoin, loadEagerParallel, select, selectEagerJoin, selectEagerParallel, setFieldMapping, where
customDelete, customInsert, customUpdate, getAlias, isCustomDelete, isCustomInsert, isCustomUpdate
public HandlerRelationMapTableFieldStrategy()
public Column[] getKeyColumns(ClassMapping cls)
LRSMapFieldStrategy
LRSMapFieldStrategy.getIndependentKeyMappings(boolean)
or
LRSMapFieldStrategy.getIndependentValueMappings(boolean)
(or null).public ColumnIO getKeyColumnIO()
public Column[] getValueColumns(ClassMapping cls)
LRSMapFieldStrategy
LRSMapFieldStrategy.getIndependentKeyMappings(boolean)
or
LRSMapFieldStrategy.getIndependentValueMappings(boolean)
(or null).public void selectKey(Select sel, ClassMapping key, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins)
LRSMapFieldStrategy
LRSMapFieldStrategy.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)
LRSMapFieldStrategy
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)
.public Result[] getResults(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode, Joins[] resJoins, boolean lrs) throws SQLException
LRSMapFieldStrategy
LRSMapFieldStrategy.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.SQLException
public Object loadKey(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
LRSMapFieldStrategy
SQLException
public Object loadValue(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
LRSMapFieldStrategy
SQLException
public Joins joinValueRelation(Joins joins, ClassMapping val)
MapTableFieldStrategy
FieldStrategy.joinRelation(org.apache.openjpa.jdbc.sql.Joins, boolean, boolean)
by default.joinValueRelation
in interface LRSMapFieldStrategy
joinValueRelation
in class MapTableFieldStrategy
public void map(boolean adapt)
Strategy
map
in interface Strategy
map
in class MapTableFieldStrategy
adapt
- 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()
Strategy
Strategy.map(boolean)
, and after all related components have been
mapped as well.initialize
in interface Strategy
initialize
in class AbstractStrategy
public void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategy
insert
in interface Strategy
insert
in class AbstractStrategy
SQLException
public void setKey(Object keyObj, JDBCStore store, Row row) throws SQLException
SQLException
public void update(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategy
update
in interface Strategy
update
in class AbstractStrategy
SQLException
Strategy.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)
FieldStrategy
joinRelation
in interface FieldStrategy
joinRelation
in class AbstractFieldStrategy
traverse
- 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)
FieldStrategy
joinKeyRelation
in interface FieldStrategy
joinKeyRelation
in class AbstractFieldStrategy
traverse
- 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)
FieldStrategy
toDataStoreValue
in interface FieldStrategy
toDataStoreValue
in class AbstractFieldStrategy
public Object toKeyDataStoreValue(Object val, JDBCStore store)
FieldStrategy
toKeyDataStoreValue
in interface FieldStrategy
toKeyDataStoreValue
in class AbstractFieldStrategy
public void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategy
delete
in interface Strategy
delete
in class MapTableFieldStrategy
SQLException
Strategy.insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)
Copyright © 2006–2017 Apache Software Foundation. All rights reserved.