|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.jdbc.meta.strats.AbstractStrategy org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy org.apache.openjpa.jdbc.meta.strats.ContainerFieldStrategy org.apache.openjpa.jdbc.meta.strats.MapTableFieldStrategy
public abstract class MapTableFieldStrategy
Base class for map mappings. Handles managing the secondary table
used to hold map keys and values and loading. Subclasses must implement
abstract methods and insert/update behavior as well as overriding
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 Summary |
---|
Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy |
---|
field |
Constructor Summary | |
---|---|
MapTableFieldStrategy()
|
Method Summary | |
---|---|
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. |
protected 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). |
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)
Invokes FieldStrategy.joinKeyRelation(org.apache.openjpa.jdbc.sql.Joins, boolean, boolean) by default. |
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. |
int |
supportsSelect(Select sel,
int type,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch)
Return whether this mapping can perform the given select type. |
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.ContainerFieldStrategy |
---|
appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendJoinCount, appendSize, appendUnaliasedJoin |
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy |
---|
assertNotMappedBy, isEagerSelectToMany, isVersionable, joinKeyRelation, joinRelation, load, loadEagerJoin, loadEagerParallel, select, selectEagerJoin, selectEagerParallel, setFieldMapping, toDataStoreValue, toKeyDataStoreValue, where |
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategy |
---|
customDelete, customInsert, customUpdate, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.openjpa.jdbc.meta.strats.LRSMapFieldStrategy |
---|
getKeyColumns, getResults, getValueColumns, loadKey, loadValue, selectKey, selectValue |
Methods inherited from interface org.apache.openjpa.jdbc.meta.FieldStrategy |
---|
appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendSize, isEagerSelectToMany, isVersionable, joinKeyRelation, joinRelation, load, loadEagerJoin, loadEagerParallel, select, selectEagerJoin, selectEagerParallel, setFieldMapping, toDataStoreValue, toKeyDataStoreValue, where |
Methods inherited from interface org.apache.openjpa.jdbc.meta.Strategy |
---|
customDelete, customInsert, customUpdate, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, update |
Constructor Detail |
---|
public MapTableFieldStrategy()
Method Detail |
---|
public FieldMapping getFieldMapping()
LRSMapFieldStrategy
getFieldMapping
in interface LRSMapFieldStrategy
public ClassMapping[] getIndependentKeyMappings(boolean traverse)
LRSMapFieldStrategy
getIndependentKeyMappings
in interface LRSMapFieldStrategy
ValueMapping.getIndependentTypeMappings()
,
ClassMapping.EMPTY_MAPPINGS
public ClassMapping[] getIndependentValueMappings(boolean traverse)
LRSMapFieldStrategy
getIndependentValueMappings
in interface LRSMapFieldStrategy
ValueMapping.getIndependentTypeMappings()
,
ClassMapping.EMPTY_MAPPINGS
public ForeignKey getJoinForeignKey(ClassMapping cls)
LRSMapFieldStrategy
LRSMapFieldStrategy.getIndependentKeyMappings(boolean)
or
LRSMapFieldStrategy.getIndependentValueMappings(boolean)
(or null).
getJoinForeignKey
in interface LRSMapFieldStrategy
public Object deriveKey(JDBCStore store, Object value)
LRSMapFieldStrategy
deriveKey
in interface LRSMapFieldStrategy
public Object deriveValue(JDBCStore store, Object key)
LRSMapFieldStrategy
deriveValue
in interface LRSMapFieldStrategy
public Joins joinKeyRelation(Joins joins, ClassMapping key)
FieldStrategy.joinKeyRelation(org.apache.openjpa.jdbc.sql.Joins, boolean, boolean)
by default.
joinKeyRelation
in interface LRSMapFieldStrategy
public Joins joinValueRelation(Joins joins, ClassMapping val)
FieldStrategy.joinRelation(org.apache.openjpa.jdbc.sql.Joins, boolean, boolean)
by default.
joinValueRelation
in interface LRSMapFieldStrategy
public void map(boolean adapt)
Strategy
map
in interface Strategy
map
in class AbstractStrategy
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 delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategy
delete
in interface Strategy
delete
in class AbstractStrategy
SQLException
Strategy.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)
FieldStrategy
supportsSelect
in interface FieldStrategy
supportsSelect
in class AbstractFieldStrategy
Select
public void load(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch) throws SQLException
FieldStrategy
load
in interface FieldStrategy
load
in class AbstractFieldStrategy
SQLException
public Object loadKeyProjection(JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
FieldStrategy
ValueMapping.getColumns()
.
loadKeyProjection
in interface FieldStrategy
loadKeyProjection
in class AbstractFieldStrategy
SQLException
public Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
FieldStrategy
ValueMapping.getColumns()
.
loadProjection
in interface FieldStrategy
loadProjection
in class AbstractFieldStrategy
SQLException
public Joins join(Joins joins, boolean forceOuter)
FieldStrategy
join
in interface FieldStrategy
join
in class AbstractFieldStrategy
public Joins joinKey(Joins joins, boolean forceOuter)
FieldStrategy
joinKey
in interface FieldStrategy
joinKey
in class AbstractFieldStrategy
protected ForeignKey getJoinForeignKey()
getJoinForeignKey
in class ContainerFieldStrategy
protected ClassMapping[] getIndependentElementMappings(boolean traverse)
ContainerFieldStrategy
getIndependentElementMappings
in class ContainerFieldStrategy
traverse
- whether we're traversing through to the related typeValueMapping.getIndependentTypeMappings()
,
ClassMapping.EMPTY_MAPPINGS
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |