Class RelationCollectionInverseKeyFieldStrategy
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
org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy
- All Implemented Interfaces:
Serializable,FieldStrategy,Strategy,LRSCollectionFieldStrategy
public class RelationCollectionInverseKeyFieldStrategy
extends RelationToManyInverseKeyFieldStrategy
implements LRSCollectionFieldStrategy
Maps a relation to a collection of other objects using an inverse
foreign key in the related object table.
- Author:
- Abe White
- See Also:
-
Field Summary
Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy
field -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionColumn[]Return the columns holding the data for a collection element for the given element mapping fromLRSCollectionFieldStrategy.getIndependentElementMappings(boolean)(or null).The owning field mapping.getIndependentElementMappings(boolean traverse) Return all independent mappings to which this strategy must join in order to access collection elements, or empty array if none.Return the foreign key used to join to the owning field for the given element mapping fromContainerFieldStrategy.getIndependentElementMappings(boolean)(or null).join(Joins joins, ClassMapping elem) Join to the owning field table for the given element mapping fromContainerFieldStrategy.getIndependentElementMappings(boolean)(or null).joinElementRelation(Joins joins, ClassMapping elem) Join this value's table to the table for the given element mapping fromContainerFieldStrategy.getIndependentElementMappings(boolean)(or null).loadElement(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 ProxyReturn a large result set proxy for this field.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).Methods inherited from class org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy
delete, initialize, insert, join, toDataStoreValue, updateMethods inherited from class org.apache.openjpa.jdbc.meta.strats.StoreCollectionFieldStrategy
add, getJoinForeignKey, isEagerSelectToMany, load, loadEagerJoin, loadEagerParallel, loadProjection, selectAll, selectEagerJoin, selectEagerParallel, supportsSelect, toCollectionMethods inherited from class org.apache.openjpa.jdbc.meta.strats.ContainerFieldStrategy
appendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendJoinCount, appendSize, appendUnaliasedJoinMethods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy
appendType, assertNotMappedBy, isVersionable, joinKey, joinKeyRelation, joinRelation, load, loadKeyProjection, select, setFieldMapping, toKeyDataStoreValue, whereMethods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
customDelete, customInsert, customUpdate, getAlias, isCustomDelete, isCustomInsert, isCustomUpdateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.openjpa.jdbc.meta.FieldStrategy
appendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendSize, appendType, isEagerSelectToMany, isVersionable, join, joinKey, joinKeyRelation, joinRelation, load, load, loadEagerJoin, loadEagerParallel, loadKeyProjection, loadProjection, select, selectEagerJoin, selectEagerParallel, setFieldMapping, supportsSelect, toDataStoreValue, toKeyDataStoreValue, whereMethods inherited from interface org.apache.openjpa.jdbc.meta.Strategy
customDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, update
-
Constructor Details
-
RelationCollectionInverseKeyFieldStrategy
public RelationCollectionInverseKeyFieldStrategy()
-
-
Method Details
-
getFieldMapping
Description copied from interface:LRSCollectionFieldStrategyThe owning field mapping.- Specified by:
getFieldMappingin interfaceLRSCollectionFieldStrategy
-
getIndependentElementMappings
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 interfaceLRSCollectionFieldStrategy- Overrides:
getIndependentElementMappingsin classRelationToManyInverseKeyFieldStrategy- Parameters:
traverse- whether we're traversing through to the related type- See Also:
-
getElementColumns
Description copied from interface:LRSCollectionFieldStrategyReturn the columns holding the data for a collection element for the given element mapping fromLRSCollectionFieldStrategy.getIndependentElementMappings(boolean)(or null).- Specified by:
getElementColumnsin interfaceLRSCollectionFieldStrategy
-
getJoinForeignKey
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 interfaceLRSCollectionFieldStrategy- Overrides:
getJoinForeignKeyin classRelationToManyInverseKeyFieldStrategy
-
selectElement
public 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 interfaceLRSCollectionFieldStrategy- Overrides:
selectElementin classRelationToManyInverseKeyFieldStrategy
-
loadElement
public Object loadElement(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws 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 interfaceLRSCollectionFieldStrategy- Overrides:
loadElementin classRelationToManyInverseKeyFieldStrategy- Throws:
SQLException
-
join
Description copied from class:StoreCollectionFieldStrategyJoin to the owning field table for the given element mapping fromContainerFieldStrategy.getIndependentElementMappings(boolean)(or null).- Overrides:
joinin classRelationToManyInverseKeyFieldStrategy
-
joinElementRelation
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 interfaceLRSCollectionFieldStrategy- Overrides:
joinElementRelationin classRelationToManyInverseKeyFieldStrategy- See Also:
-
newLRSProxy
Description copied from class:StoreCollectionFieldStrategyReturn a large result set proxy for this field.- Specified by:
newLRSProxyin classStoreCollectionFieldStrategy
-
map
public void map(boolean adapt) Description copied from interface:StrategyMap the owning mapping using this strategy.- Specified by:
mapin interfaceStrategy- Overrides:
mapin classRelationToManyInverseKeyFieldStrategy- 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
-