public abstract class RelationToManyInverseKeyFieldStrategy extends StoreCollectionFieldStrategy
field
Constructor and Description |
---|
RelationToManyInverseKeyFieldStrategy() |
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.
|
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.
|
protected ForeignKey |
getJoinForeignKey(ClassMapping elem)
Return the foreign key used to join to the owning field for the given
element mapping from
ContainerFieldStrategy.getIndependentElementMappings(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 |
join(Joins joins,
boolean forceOuter)
Join this value to the class table.
|
protected Joins |
join(Joins joins,
ClassMapping elem)
Join to the owning field table for the given element mapping from
ContainerFieldStrategy.getIndependentElementMappings(boolean) (or null). |
protected Joins |
joinElementRelation(Joins joins,
ClassMapping elem)
Join this value's table to the table for the given element mapping
from
ContainerFieldStrategy.getIndependentElementMappings(boolean) (or null). |
protected Object |
loadElement(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
Result res,
Joins joins)
Load an element of the collection.
|
void |
map(boolean adapt)
Map the owning mapping using this strategy.
|
protected void |
selectElement(Select sel,
ClassMapping elem,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eagerMode,
Joins joins)
Implement this method to select the elements of this field for the
given element mapping from
ContainerFieldStrategy.getIndependentElementMappings(boolean)
(or null). |
Object |
toDataStoreValue(Object val,
JDBCStore store)
Translate the given external field value to its datastore equivalent.
|
void |
update(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
Set values for the mapping into the proper rows.
|
add, getJoinForeignKey, isEagerSelectToMany, load, loadEagerJoin, loadEagerParallel, loadProjection, newLRSProxy, selectAll, selectEagerJoin, selectEagerParallel, supportsSelect, toCollection
appendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendJoinCount, appendSize, appendUnaliasedJoin
appendType, assertNotMappedBy, isVersionable, joinKey, joinKeyRelation, joinRelation, load, loadKeyProjection, select, setFieldMapping, toKeyDataStoreValue, where
customDelete, customInsert, customUpdate, getAlias, isCustomDelete, isCustomInsert, isCustomUpdate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
customDelete, customInsert, customUpdate, getAlias, isCustomDelete, isCustomInsert, isCustomUpdate
public RelationToManyInverseKeyFieldStrategy()
protected ClassMapping[] getIndependentElementMappings(boolean traverse)
ContainerFieldStrategy
getIndependentElementMappings
in class ContainerFieldStrategy
traverse
- whether we're traversing through to the related typeValueMapping.getIndependentTypeMappings()
,
ClassMapping.EMPTY_MAPPINGS
protected ForeignKey getJoinForeignKey(ClassMapping elem)
StoreCollectionFieldStrategy
ContainerFieldStrategy.getIndependentElementMappings(boolean)
(or null).getJoinForeignKey
in class StoreCollectionFieldStrategy
protected void selectElement(Select sel, ClassMapping elem, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode, Joins joins)
StoreCollectionFieldStrategy
ContainerFieldStrategy.getIndependentElementMappings(boolean)
(or null). Elements of the result will be loaded with
StoreCollectionFieldStrategy.loadElement(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)
.selectElement
in class StoreCollectionFieldStrategy
protected Object loadElement(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
StoreCollectionFieldStrategy
loadElement
in class StoreCollectionFieldStrategy
SQLException
protected Joins join(Joins joins, ClassMapping elem)
StoreCollectionFieldStrategy
ContainerFieldStrategy.getIndependentElementMappings(boolean)
(or null).join
in class StoreCollectionFieldStrategy
protected Joins joinElementRelation(Joins joins, ClassMapping elem)
StoreCollectionFieldStrategy
ContainerFieldStrategy.getIndependentElementMappings(boolean)
(or null).joinElementRelation
in class StoreCollectionFieldStrategy
FieldMapping.joinRelation(org.apache.openjpa.jdbc.sql.Joins, boolean, boolean)
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 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 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 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 Object toDataStoreValue(Object val, JDBCStore store)
FieldStrategy
toDataStoreValue
in interface FieldStrategy
toDataStoreValue
in class AbstractFieldStrategy
public Joins join(Joins joins, boolean forceOuter)
FieldStrategy
join
in interface FieldStrategy
join
in class AbstractFieldStrategy
Copyright © 2006–2018 Apache Software Foundation. All rights reserved.