Class RelationToManyInverseKeyFieldStrategy
- 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.StoreCollectionFieldStrategy
- 
- org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy
 
 
 
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- FieldStrategy,- Strategy
 - Direct Known Subclasses:
- RelationCollectionInverseKeyFieldStrategy,- RelationMapInverseKeyFieldStrategy
 
 public abstract class RelationToManyInverseKeyFieldStrategy extends StoreCollectionFieldStrategy Maps a relation to a set of other objects using an inverse foreign key in the related object table.- Author:
- Abe White
- See Also:
- Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategyfield
 
- 
 - 
Constructor SummaryConstructors Constructor Description RelationToManyInverseKeyFieldStrategy()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(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 ForeignKeygetJoinForeignKey(ClassMapping elem)Return the foreign key used to join to the owning field for the given element mapping fromContainerFieldStrategy.getIndependentElementMappings(boolean)(or null).voidinitialize()Perform caching and other initialization operations.voidinsert(OpenJPAStateManager sm, JDBCStore store, RowManager rm)Set values for the mapping into the proper rows.Joinsjoin(Joins joins, boolean forceOuter)Join this value to the class table.protected Joinsjoin(Joins joins, ClassMapping elem)Join to the owning field table for the given element mapping fromContainerFieldStrategy.getIndependentElementMappings(boolean)(or null).protected JoinsjoinElementRelation(Joins joins, ClassMapping elem)Join this value's table to the table for the given element mapping fromContainerFieldStrategy.getIndependentElementMappings(boolean)(or null).protected java.lang.ObjectloadElement(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins)Load an element of the collection.voidmap(boolean adapt)Map the owning mapping using this strategy.protected voidselectElement(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 fromContainerFieldStrategy.getIndependentElementMappings(boolean)(or null).java.lang.ObjecttoDataStoreValue(java.lang.Object val, JDBCStore store)Translate the given external field value to its datastore equivalent.voidupdate(OpenJPAStateManager sm, JDBCStore store, RowManager rm)Set values for the mapping into the proper rows.- 
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.StoreCollectionFieldStrategyadd, getJoinForeignKey, isEagerSelectToMany, load, loadEagerJoin, loadEagerParallel, loadProjection, newLRSProxy, selectAll, selectEagerJoin, selectEagerParallel, supportsSelect, toCollection
 - 
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.ContainerFieldStrategyappendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendJoinCount, appendSize, appendUnaliasedJoin
 - 
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategyappendType, assertNotMappedBy, isVersionable, joinKey, joinKeyRelation, joinRelation, load, loadKeyProjection, select, setFieldMapping, toKeyDataStoreValue, where
 - 
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategycustomDelete, customInsert, customUpdate, getAlias, isCustomDelete, isCustomInsert, isCustomUpdate
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.openjpa.jdbc.meta.StrategycustomDelete, customInsert, customUpdate, getAlias, isCustomDelete, isCustomInsert, isCustomUpdate
 
- 
 
- 
- 
- 
Method Detail- 
getIndependentElementMappingsprotected ClassMapping[] getIndependentElementMappings(boolean traverse) Description copied from class:ContainerFieldStrategyReturn all independent mappings to which this strategy must join in order to access collection elements, or empty array if none.- Specified by:
- getIndependentElementMappingsin class- ContainerFieldStrategy
- Parameters:
- traverse- whether we're traversing through to the related type
- See Also:
- ValueMapping.getIndependentTypeMappings(),- ClassMapping.EMPTY_MAPPINGS
 
 - 
getJoinForeignKeyprotected ForeignKey getJoinForeignKey(ClassMapping elem) Description copied from class:StoreCollectionFieldStrategyReturn the foreign key used to join to the owning field for the given element mapping fromContainerFieldStrategy.getIndependentElementMappings(boolean)(or null).- Specified by:
- getJoinForeignKeyin class- StoreCollectionFieldStrategy
 
 - 
selectElementprotected void selectElement(Select sel, ClassMapping elem, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode, Joins joins) Description copied from class:StoreCollectionFieldStrategyImplement this method to select the elements of this field for the given element mapping fromContainerFieldStrategy.getIndependentElementMappings(boolean)(or null). Elements of the result will be loaded withStoreCollectionFieldStrategy.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).- Specified by:
- selectElementin class- StoreCollectionFieldStrategy
 
 - 
loadElementprotected java.lang.Object loadElement(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws java.sql.SQLException Description copied from class:StoreCollectionFieldStrategyLoad an element of the collection. The given state manager might be null if the load is for a projection or for processing eager parallel results.- Specified by:
- loadElementin class- StoreCollectionFieldStrategy
- Throws:
- java.sql.SQLException
 
 - 
joinprotected Joins join(Joins joins, ClassMapping elem) Description copied from class:StoreCollectionFieldStrategyJoin to the owning field table for the given element mapping fromContainerFieldStrategy.getIndependentElementMappings(boolean)(or null).- Specified by:
- joinin class- StoreCollectionFieldStrategy
 
 - 
joinElementRelationprotected Joins joinElementRelation(Joins joins, ClassMapping elem) Description copied from class:StoreCollectionFieldStrategyJoin this value's table to the table for the given element mapping fromContainerFieldStrategy.getIndependentElementMappings(boolean)(or null).- Specified by:
- joinElementRelationin class- StoreCollectionFieldStrategy
- See Also:
- FieldMapping.joinRelation(org.apache.openjpa.jdbc.sql.Joins, boolean, boolean)
 
 - 
mappublic void map(boolean adapt) Description copied from interface:StrategyMap the owning mapping using this strategy.- Specified by:
- mapin interface- Strategy
- Overrides:
- mapin class- AbstractStrategy
- Parameters:
- adapt- if true, use the owning mapping's raw mapping info to set its ORM data; if false, ORM data will already be set
 
 - 
initializepublic void initialize() Description copied from interface:StrategyPerform caching and other initialization operations. This method is called afterStrategy.map(boolean), and after all related components have been mapped as well.- Specified by:
- initializein interface- Strategy
- Overrides:
- initializein class- AbstractStrategy
 
 - 
insertpublic void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws java.sql.SQLException Description copied from interface:StrategySet values for the mapping into the proper rows. For class mappings, this method will be called only after the corresponding method has been called for all fields of this mapping.- Specified by:
- insertin interface- Strategy
- Overrides:
- insertin class- AbstractStrategy
- Throws:
- java.sql.SQLException
 
 - 
updatepublic void update(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws java.sql.SQLException Description copied from interface:StrategySet values for the mapping into the proper rows.- Specified by:
- updatein interface- Strategy
- Overrides:
- updatein class- AbstractStrategy
- Throws:
- java.sql.SQLException
- See Also:
- Strategy.insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)
 
 - 
deletepublic void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws java.sql.SQLException Description copied from interface:StrategySet the where values appropriately to delete the proper instance, and set all relations on non-secondary tables as updates. This allows foreign key analysis.- Specified by:
- deletein interface- Strategy
- Overrides:
- deletein class- AbstractStrategy
- Throws:
- java.sql.SQLException
- See Also:
- Strategy.insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)
 
 - 
toDataStoreValuepublic java.lang.Object toDataStoreValue(java.lang.Object val, JDBCStore store)Description copied from interface:FieldStrategyTranslate the given external field value to its datastore equivalent. If the mapping occupies multiple columns in the datastore, return an object array, else return a single object. Simply returns the given object by default.- Specified by:
- toDataStoreValuein interface- FieldStrategy
- Overrides:
- toDataStoreValuein class- AbstractFieldStrategy
 
 - 
joinpublic Joins join(Joins joins, boolean forceOuter) Description copied from interface:FieldStrategyJoin this value to the class table. Does nothing by default.- Specified by:
- joinin interface- FieldStrategy
- Overrides:
- joinin class- AbstractFieldStrategy
 
 
- 
 
-