public abstract class AbstractFieldStrategy extends AbstractStrategy implements FieldStrategy
| Modifier and Type | Field and Description |
|---|---|
protected FieldMapping |
field
The owning field mapping.
|
| Constructor and Description |
|---|
AbstractFieldStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
appendIndex(SQLBuffer sql,
Select sel,
Joins joins)
Append the ordered column alias to the given statement.
|
void |
appendIsEmpty(SQLBuffer sql,
Select sel,
Joins joins)
Append a where clause to the given statement checking if this value
is empty.
|
void |
appendIsNotEmpty(SQLBuffer sql,
Select sel,
Joins joins)
Append a where clause to the given statement checking if this value
is not empty.
|
void |
appendIsNotNull(SQLBuffer sql,
Select sel,
Joins joins)
Append a where clause to the given statement checking if this value
is not null.
|
void |
appendIsNull(SQLBuffer sql,
Select sel,
Joins joins)
Append a where clause to the given statement checking if this value
is null.
|
void |
appendSize(SQLBuffer sql,
Select sel,
Joins joins)
Append a where clause to the given statement checking the size
of the value.
|
void |
appendType(SQLBuffer sql,
Select sel,
Joins joins)
Append the entity discriminator value to the given statement.
|
protected void |
assertNotMappedBy()
Throws an informative exception if the field declares a mapped-by value.
|
boolean |
isEagerSelectToMany()
Whether the eager joins or selects used by this field are to-many.
|
boolean |
isVersionable()
Return true if this field can be used as part of a state image for
optimistic locking.
|
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,
boolean forceOuter,
boolean traverse)
Join this value's table to the table for the related first class object
key type, if any.
|
Joins |
joinRelation(Joins joins,
boolean forceOuter,
boolean traverse)
Join this value's table to the table for the related first class object
type, if any.
|
void |
load(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch)
Load secondary data using a connection from the store manager.
|
void |
load(OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
Result res)
Load virtual row data; the given result is not guaranteed to contain
data for this field, so the field mapping should make sure the
result contains its needed column data before loading.
|
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.
|
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.
|
int |
select(Select sel,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eagerMode)
Select the virtual row columns of this mapping.
|
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.
|
void |
setFieldMapping(FieldMapping owner)
Set the class 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.
|
Object |
toDataStoreValue(Object val,
JDBCStore store)
Translate the given external field value to its datastore equivalent.
|
Object |
toKeyDataStoreValue(Object val,
JDBCStore store)
Translate the given key value to its datastore equivalent.
|
void |
where(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm,
Object prevValue)
Add a WHERE condition to the row for this field such that the field's
current DB value must equal the given previous value.
|
customDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcustomDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, updateprotected FieldMapping field
protected void assertNotMappedBy()
public void setFieldMapping(FieldMapping owner)
FieldStrategysetFieldMapping in interface FieldStrategypublic int supportsSelect(Select sel, int type, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch)
FieldStrategysupportsSelect in interface FieldStrategySelectpublic void selectEagerJoin(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode)
FieldStrategypublic void selectEagerParallel(SelectExecutor sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode)
FieldStrategypublic boolean isEagerSelectToMany()
FieldStrategyisEagerSelectToMany in interface FieldStrategypublic int select(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode)
FieldStrategyselect in interface FieldStrategysel - the select to add tosm - the instance being loaded, or null if not
initialized yet or selecting for multiple instancesstore - the current store managerfetch - fetch configurationeagerMode - the eager fetch mode to use; this may be more
restrictive than the mode of the fetch configurationpublic Object loadEagerParallel(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Object res) throws SQLException
FieldStrategyloadEagerParallel in interface FieldStrategyres - originally the Result to load from, but this
method may return a processed result form that will be
passed to subsequent callsSQLExceptionpublic void loadEagerJoin(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res) throws SQLException
FieldStrategyloadEagerJoin in interface FieldStrategySQLExceptionpublic void load(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res) throws SQLException
FieldStrategyload in interface FieldStrategySQLExceptionpublic void load(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch) throws SQLException
FieldStrategyload in interface FieldStrategySQLExceptionpublic Object toDataStoreValue(Object val, JDBCStore store)
FieldStrategytoDataStoreValue in interface FieldStrategypublic Object toKeyDataStoreValue(Object val, JDBCStore store)
FieldStrategytoKeyDataStoreValue in interface FieldStrategypublic void appendIsEmpty(SQLBuffer sql, Select sel, Joins joins)
FieldStrategyappendIsEmpty in interface FieldStrategypublic void appendIsNotEmpty(SQLBuffer sql, Select sel, Joins joins)
FieldStrategyappendIsNotEmpty in interface FieldStrategypublic void appendIsNull(SQLBuffer sql, Select sel, Joins joins)
FieldStrategyappendIsNull in interface FieldStrategypublic void appendIsNotNull(SQLBuffer sql, Select sel, Joins joins)
FieldStrategyappendIsNotNull in interface FieldStrategypublic void appendSize(SQLBuffer sql, Select sel, Joins joins)
FieldStrategyappendSize in interface FieldStrategypublic void appendIndex(SQLBuffer sql, Select sel, Joins joins)
FieldStrategyappendIndex in interface FieldStrategypublic void appendType(SQLBuffer sql, Select sel, Joins joins)
FieldStrategyappendType in interface FieldStrategypublic Joins join(Joins joins, boolean forceOuter)
FieldStrategyjoin in interface FieldStrategypublic Joins joinKey(Joins joins, boolean forceOuter)
FieldStrategyjoinKey in interface FieldStrategypublic Joins joinRelation(Joins joins, boolean forceOuter, boolean traverse)
FieldStrategyjoinRelation in interface FieldStrategytraverse - if true, throw proper exception if it is not
possible for this mapping to traverse into the related typepublic Joins joinKeyRelation(Joins joins, boolean forceOuter, boolean traverse)
FieldStrategyjoinKeyRelation in interface FieldStrategytraverse - if true, throw proper exception if it is not
possible for this mapping to traverse into the related typepublic Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
FieldStrategyValueMapping.getColumns().loadProjection in interface FieldStrategySQLExceptionpublic Object loadKeyProjection(JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException
FieldStrategyValueMapping.getColumns().loadKeyProjection in interface FieldStrategySQLExceptionpublic boolean isVersionable()
FieldStrategyisVersionable in interface FieldStrategypublic void where(OpenJPAStateManager sm, JDBCStore store, RowManager rm, Object prevValue) throws SQLException
FieldStrategywhere in interface FieldStrategySQLExceptionCopyright © 2006–2019 Apache Software Foundation. All rights reserved.