public abstract class StoreCollectionFieldStrategy extends ContainerFieldStrategy
FieldStrategy.toDataStoreValue(java.lang.Object, org.apache.openjpa.jdbc.kernel.JDBCStore)
, FieldStrategy.join(org.apache.openjpa.jdbc.sql.Joins, boolean)
, and
FieldStrategy.joinRelation(org.apache.openjpa.jdbc.sql.Joins, boolean, boolean)
if necessary.field
Constructor and Description |
---|
StoreCollectionFieldStrategy() |
Modifier and Type | Method and Description |
---|---|
protected void |
add(JDBCStore store,
Object coll,
Object obj)
Add an item to the data structure representing a field value.
|
ForeignKey |
getJoinForeignKey() |
protected abstract 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). |
boolean |
isEagerSelectToMany()
Whether the eager joins or selects used by this field are to-many.
|
protected abstract Joins |
join(Joins joins,
ClassMapping elem)
Join to the owning field table for the given element mapping from
ContainerFieldStrategy.getIndependentElementMappings(boolean) (or null). |
protected abstract 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). |
void |
load(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch)
Load secondary data using a connection from the store manager.
|
void |
loadEagerJoin(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
Result res)
Load the joined eager result.
|
Object |
loadEagerParallel(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
Object res)
Load the batched eager result.
|
protected abstract Object |
loadElement(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
Result res,
Joins joins)
Load an element of the collection.
|
Object |
loadProjection(JDBCStore store,
JDBCFetchConfiguration fetch,
Result res,
Joins joins)
Load this field value using the given result.
|
protected abstract Proxy |
newLRSProxy()
Return a large result set proxy for this field.
|
protected Joins |
selectAll(Select sel,
ClassMapping elem,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eagerMode)
Select data for loading, starting in field table.
|
void |
selectEagerJoin(Select sel,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eagerMode)
Fill in joined select to related objects.
|
void |
selectEagerParallel(SelectExecutor sel,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eagerMode)
Fill in parallel eager select for related objects.
|
protected abstract 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). |
int |
supportsSelect(Select sel,
int type,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch)
Return whether this mapping can perform the given select type.
|
protected Collection |
toCollection(Object val)
Convert the field value to a collection.
|
appendIndex, appendIsEmpty, appendIsNotEmpty, appendIsNotNull, appendIsNull, appendJoinCount, appendSize, appendUnaliasedJoin, getIndependentElementMappings
appendType, assertNotMappedBy, isVersionable, join, joinKey, joinKeyRelation, joinRelation, load, loadKeyProjection, select, setFieldMapping, toDataStoreValue, toKeyDataStoreValue, where
customDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
customDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, update
protected abstract ForeignKey getJoinForeignKey(ClassMapping elem)
ContainerFieldStrategy.getIndependentElementMappings(boolean)
(or null).protected abstract void selectElement(Select sel, ClassMapping elem, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode, Joins joins)
ContainerFieldStrategy.getIndependentElementMappings(boolean)
(or null). Elements of the result will be loaded with
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)
.protected abstract Object loadElement(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
SQLException
protected abstract Joins joinElementRelation(Joins joins, ClassMapping elem)
ContainerFieldStrategy.getIndependentElementMappings(boolean)
(or null).protected abstract Joins join(Joins joins, ClassMapping elem)
ContainerFieldStrategy.getIndependentElementMappings(boolean)
(or null).protected abstract Proxy newLRSProxy()
protected Collection toCollection(Object val)
protected void add(JDBCStore store, Object coll, Object obj)
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 selectEagerParallel(SelectExecutor sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode)
FieldStrategy
selectEagerParallel
in interface FieldStrategy
selectEagerParallel
in class AbstractFieldStrategy
FieldStrategy.select(org.apache.openjpa.jdbc.sql.Select, org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration, int)
public void selectEagerJoin(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode)
FieldStrategy
selectEagerJoin
in interface FieldStrategy
selectEagerJoin
in class AbstractFieldStrategy
FieldStrategy.select(org.apache.openjpa.jdbc.sql.Select, org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration, int)
public boolean isEagerSelectToMany()
FieldStrategy
isEagerSelectToMany
in interface FieldStrategy
isEagerSelectToMany
in class AbstractFieldStrategy
public Object loadEagerParallel(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Object res) throws SQLException
FieldStrategy
loadEagerParallel
in interface FieldStrategy
loadEagerParallel
in class AbstractFieldStrategy
res
- originally the Result
to load from, but this
method may return a processed result form that will be
passed to subsequent callsSQLException
public void loadEagerJoin(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res) throws SQLException
FieldStrategy
loadEagerJoin
in interface FieldStrategy
loadEagerJoin
in class AbstractFieldStrategy
SQLException
public void load(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch) throws SQLException
FieldStrategy
load
in interface FieldStrategy
load
in class AbstractFieldStrategy
SQLException
protected Joins selectAll(Select sel, ClassMapping elem, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode)
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 ForeignKey getJoinForeignKey()
getJoinForeignKey
in class ContainerFieldStrategy
Copyright © 2006–2020 Apache Software Foundation. All rights reserved.