public class FieldMapping extends FieldMetaData implements ValueMapping, FieldStrategy
FieldMetaData.MemberProviderMANAGE_NONE, MANAGE_PERSISTENT, MANAGE_TRANSACTIONAL, MANY_TO_MANY, MANY_TO_ONE, NULL_DEFAULT, NULL_EXCEPTION, NULL_NONE, NULL_UNSET, ONE_TO_MANY, ONE_TO_ONEOPENJPAJOIN_EXPECTED_INVERSE, JOIN_FORWARD, JOIN_INVERSE, POLY_FALSE, POLY_JOINABLE, POLY_TRUECASCADE_AUTO, CASCADE_IMMEDIATE, CASCADE_NONE, MAPPED_BY_PKMODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERYEMPTY_COMMENTS| Constructor and Description |
|---|
FieldMapping(String name,
Class<?> type,
ClassMapping owner)
Constructor.
|
| 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.
|
void |
clearMapping()
Clear mapping information, including strategy.
|
void |
copy(FieldMetaData fmd)
Copy state from the given field to this one.
|
void |
copyMappingInfo(FieldMapping fm)
Copy mapping info from the given instance to this one.
|
void |
copyMappingInfo(ValueMapping vm)
Copy mapping info from the given instance to this one.
|
void |
customDelete(OpenJPAStateManager sm,
JDBCStore store)
Override this method to customize flushing this mapping.
|
void |
customInsert(OpenJPAStateManager sm,
JDBCStore store)
Override this method to customize flushing this mapping.
|
void |
customUpdate(OpenJPAStateManager sm,
JDBCStore store)
Override this method to customize flushing this mapping.
|
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.
|
void |
deleteRow(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
Delete the row for this object if the reference foreign key exists.
|
String |
getAlias()
Return the alias of this strategy.
|
FieldMapping |
getBi_1ToM_JTField() |
FieldMapping |
getBi_MTo1_JTField() |
ForeignKey |
getBi1ToMElemFK() |
ForeignKey |
getBi1ToMJoinFK() |
ColumnIO |
getColumnIO()
I/O information on the foreign key, or columns if this value doesn't
have a key.
|
Column[] |
getColumns()
The columns that hold the data for this value.
|
ClassMapping |
getDeclaredTypeMapping()
Convenience method to perform cast from
ValueMetaData.getDeclaredTypeMetaData(). |
ClassMapping |
getDeclaringMapping()
Convenience method to perform cast from
FieldMetaData.getDeclaringMetaData() |
ClassMapping |
getDefiningMapping()
Convenience method to perform cast from
FieldMetaData.getDefiningMetaData() |
int |
getEagerFetchMode()
The eager fetch mode, as one of the eager constants in
JDBCFetchConfiguration. |
ValueMapping |
getElementMapping()
Convenience method to perform cast from
FieldMetaData.getElement() |
ClassMapping |
getEmbeddedMapping()
Convenience method to perform cast from
ValueMetaData.getEmbeddedMetaData(). |
FieldMapping |
getFieldMapping()
Convenience method to perform cast from
ValueMetaData.getFieldMetaData(). |
ForeignKey |
getForeignKey()
If this value joins to another record, the foreign key.
|
ForeignKey |
getForeignKey(ClassMapping target)
Return an equivalent of this value's foreign key, but joining to the
given target, which may be an unjoined subclass of this value's
related type.
|
ValueHandler |
getHandler()
The handler used for this value, or null if none.
|
ClassMapping[] |
getIndependentTypeMappings()
Return all independently-mapped joinable types for this value, depending
on whether this value is polymorphic and how the related type is mapped.
|
FieldMapping[] |
getInverseMappings()
Convenience method to perform cast from
FieldMetaData.getInverseMetaDatas() |
ColumnIO |
getJoinColumnIO()
I/O information on the join columns.
|
int |
getJoinDirection()
The join direction.
|
ForeignKey |
getJoinForeignKey()
Foreign key linking the field table to the class' primary table.
|
Index |
getJoinIndex()
Index on join foreign key columns.
|
Unique[] |
getJoinTableUniques() |
Unique |
getJoinUnique()
Unique constraint on join foreign key columns.
|
ValueMapping |
getKeyMapping()
Convenience method to perform cast from
FieldMetaData.getKey() |
FieldMapping |
getMappedByMapping()
Convenience method to perform cast from
FieldMetaData.getMappedByMetaData() |
FieldMappingInfo |
getMappingInfo()
Raw mapping data about field's join to parent table, as well as
miscellaneous specialized columns like order column.
|
MappingRepository |
getMappingRepository()
Convenience method to perform cast from
FieldMetaData.getRepository() |
Column |
getOrderColumn()
Field order column, if any.
|
ColumnIO |
getOrderColumnIO()
I/O information for order column.
|
int |
getPolymorphic()
The degree to which this relation is polymorphic.
|
Row |
getRow(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm,
int action)
Return the row to use for this field.
|
int |
getSelectSubclasses()
Return the
org.apache.openjpa.sql.Select subclasses constant
for loading this relation, based on how the related type is mapped,
whether this relation is polymorphic, and whether it is configured to
use class criteria. |
FieldStrategy |
getStrategy()
The strategy used to map this mapping.
|
Table |
getTable()
The mapping's primary table.
|
ClassMapping |
getTypeMapping()
Convenience method to perform cast from
ValueMetaData.getTypeMetaData(). |
boolean |
getUseClassCriteria()
Whether to use class criteria when joining to related type.
|
Index |
getValueIndex()
Index on this value's columns, or null if none.
|
ValueMappingInfo |
getValueInfo()
Raw mapping data.
|
FieldMapping |
getValueMappedByMapping()
Convenience method to perform cast from
ValueMetaData.getValueMappedByMetaData(). |
ValueMapping |
getValueMapping()
Convenience method to perform cast from
FieldMetaData.getValue() |
Unique |
getValueUnique()
Unique constraint on this value's columns, or null if none.
|
boolean |
hasMapsIdCols() |
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.
|
boolean |
isBi1To1JT() |
boolean |
isBidirectionalJoinTableMappingNonOwner()
Affirms if this field is the non-owning side of a bidirectional relation
with a join table.
|
boolean |
isBidirectionalJoinTableMappingOwner()
Affirms if this field is the owning side of a bidirectional relation
with a join table.
|
boolean |
isBiMTo1JT() |
Boolean |
isCustomDelete(OpenJPAStateManager sm,
JDBCStore store)
Return
Boolean.FALSE if this mapping does not customize the
delete process, Boolean.TRUE if it does, or null if it does
customize the delete, but also relies on the standard delete method
being called. |
Boolean |
isCustomInsert(OpenJPAStateManager sm,
JDBCStore store)
Return
Boolean.FALSE if this mapping does not customize the
insert process, Boolean.TRUE if it does, or null if it does
customize the insert, but also relies on the standard insert method
being called. |
Boolean |
isCustomUpdate(OpenJPAStateManager sm,
JDBCStore store)
Return
Boolean.FALSE if this mapping does not customize the
update process, Boolean.TRUE if it does, or null if it does
customize the update, but also relies on the standard update method
being called. |
boolean |
isDelayCapable() |
boolean |
isEagerSelectToMany()
Whether the eager joins or selects used by this field are to-many.
|
boolean |
isJoinOuter()
Whether to use an outer join from the class' primary table.
|
boolean |
isMapped()
Returns true if field class does not use the "none" strategy (including
if it has a null strategy, and therefore is probably in the process of
being mapped).
|
boolean |
isNonDefaultMappingUsingJoinTableStrategy() |
boolean |
isUni1To1JT() |
boolean |
isUni1ToMFK() |
boolean |
isUniMTo1JT() |
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 |
join(Joins joins,
boolean forceOuter,
boolean toMany)
Joins from the owning class' table to the table where this field lies
using the join foreign key.
|
Joins |
join(Select sel)
Return any joins needed to get from the primary table to this 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.
|
void |
map(boolean adapt)
Map the owning mapping using this strategy.
|
void |
mapConstraints(DBIdentifier name,
boolean adapt)
Map indexes and constraints for this value, using the current
ValueMappingInfo. |
void |
mapConstraints(String name,
boolean adapt)
Deprecated.
|
void |
mapJoin(boolean adapt,
boolean joinRequired)
Map this field to its table, optionally requiring that it be
in another table.
|
void |
mapPrimaryKey(boolean adapt)
Maps the primary key on the secondary table for this field, if the
user's defaults create one.
|
void |
orderLocal(Select sel,
ClassMapping elem,
Joins joins)
Add ordering to the given select for all non-relation order values,
including the synthetic order column, if any.
|
void |
orderRelation(Select sel,
ClassMapping elem,
Joins joins)
Add ordering to the given select for all relation-based values.
|
void |
refSchemaComponents()
Increment the reference count of used schema components.
|
boolean |
resolve(int mode)
Resolve and validate metadata.
|
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 |
setBi1MJoinTableInfo() |
void |
setColumnIO(ColumnIO io)
I/O information on the foreign key, or columns if this value doesn't
have a key.
|
void |
setColumns(Column[] cols)
The columns that hold the data for this value.
|
void |
setEagerFetchMode(int mode)
The eager fetch mode, as one of the eager constants in
JDBCFetchConfiguration. |
void |
setFieldMapping(FieldMapping owner)
Set the class mapping using this strategy.
|
void |
setForeignKey(ForeignKey fk)
If this value joins to another record, the foreign key.
|
void |
setForeignKey(Row row,
OpenJPAStateManager sm)
Sets this value's foreign key to the given related object.
|
void |
setForeignKey(Row row,
OpenJPAStateManager sm,
int targetNumber)
Sets this value's foreign key to the given related object.
|
void |
setHandler(ValueHandler handler)
The handler used for this value, or null if none.
|
void |
setJoinColumnIO(ColumnIO io)
I/O information on the join columns.
|
void |
setJoinDirection(int direction)
The join direction.
|
void |
setJoinForeignKey(ForeignKey fk)
Foreign key linking the field table to the class' primary table.
|
void |
setJoinIndex(Index idx)
Index on join foreign key columns.
|
void |
setJoinOuter(boolean outer)
Whether to use an outer join from the class' primary table.
|
void |
setJoinTableUniques(Unique[] unqs) |
void |
setJoinUnique(Unique unq)
Unique constraint on join foreign key columns.
|
void |
setMappedByIdValue(Object target,
Object val,
String mappedByIdFieldName) |
void |
setMapsIdCols(boolean hasMapsIdCols) |
void |
setOrderColumn(Column order)
Field order column, if any.
|
void |
setOrderColumnIO(ColumnIO io)
I/O information for order column.
|
void |
setPolymorphic(int poly)
The degree to which this relation is polymorphic.
|
void |
setStrategy(FieldStrategy strategy,
Boolean adapt)
The strategy used to map this mapping.
|
void |
setUseClassCriteria(boolean criteria)
Whether to use class criteria when joining to related type.
|
void |
setValueIndex(Index idx)
Index on this value's columns, or null if none.
|
void |
setValueUnique(Unique unq)
Unique constraint on this value's columns, or null if none.
|
int |
supportsSelect(Select sel,
int type,
OpenJPAStateManager sm,
JDBCStore store,
JDBCFetchConfiguration fetch)
Return whether this mapping can perform the given select type.
|
void |
syncMappingInfo()
Update
MappingInfo with our current mapping information. |
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 |
update(OpenJPAStateManager sm,
JDBCStore store,
RowManager rm)
Set values for the mapping into the proper rows.
|
protected boolean |
validateDataStoreExtensionPrefix(String prefix)
Return true if extensions starting with the given official datastore
prefix should be validated for this runtime.
|
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.
|
void |
whereForeignKey(Row row,
OpenJPAStateManager sm)
Sets this value's foreign key to the given related object.
|
void |
wherePrimaryKey(Select sel,
OpenJPAStateManager sm,
JDBCStore store)
Add a
wherePrimaryKey or whereForeignKey
condition to the given select, depending on whether we have a join
foreign key. |
addEmbeddedMetaData, addEmbeddedMetaData, addExtensionKeys, backingMember, compareTo, copy, equals, getAccessType, getAssociationType, getBackingMember, getCascadeAttach, getCascadeDelete, getCascadeDetach, getCascadePersist, getCascadeRefresh, getComments, getConverter, getCustomFetchGroups, getDeclaredIndex, getDeclaredType, getDeclaredTypeCode, getDeclaredTypeMetaData, getDeclaringMetaData, getDeclaringType, getDefiningMetaData, getElement, getEmbeddedMetaData, getExternalizer, getExternalizerMethod, getExternalValue, getExternalValueMap, getExternalValues, getFactory, getFactoryMethod, getFieldMetaData, getFieldValue, getFieldValueMap, getFullName, getFullName, getIndex, getInitializer, getInverse, getInverseMetaDatas, getKey, getListingIndex, getLoadFetchGroup, getManagement, getMappedBy, getMappedByField, getMappedByIdValue, getMappedByMetaData, getName, getNullValue, getObjectIdFieldType, getObjectIdFieldTypeCode, getOrderDeclaration, getOrders, getPrimaryKeyIndex, getProxyType, getRealName, getRelationType, getRepository, getResolve, getSetterName, getType, getTypeCode, getTypeMetaData, getTypeOverride, getUpdateStrategy, getUseSchemaElement, getValue, getValueMappedBy, getValueMappedByMetaData, getValueSequenceMetaData, getValueSequenceName, getValueStrategy, hashCode, isDeclaredTypePC, isDefaultFetchGroupExplicit, isElementCollection, isEmbedded, isEmbeddedPC, isExplicit, isExternalized, isInDefaultFetchGroup, isInFetchGroup, isLRS, isMappedById, isPersistentCollection, isPrimaryKey, isSerialized, isStream, isTransient, isTypePC, isUsedInOrderBy, isValueGenerated, isVersion, order, setAccessType, setAssociationType, setCascadeAttach, setCascadeDelete, setCascadeDetach, setCascadePersist, setCascadePersist, setCascadeRefresh, setComments, setConverter, setDeclaredIndex, setDeclaredType, setDeclaredTypeCode, setDeclaringType, setDefaultFetchGroupExplicit, setDelayCapable, setElementCollection, setEmbedded, setExplicit, setExternalizer, setExternalValues, setFactory, setInDefaultFetchGroup, setIndex, setInFetchGroup, setInitializer, setInverse, setListingIndex, setLoadFetchGroup, setLRS, setManagement, setMappedBy, setMappedByIdValue, setNullValue, setOrderDeclaration, setOrders, setPersistentCollection, setPrimaryKey, setPrimaryKeyIndex, setProxyType, setResolve, setResolve, setSerialized, setStream, setTransient, setType, setTypeCode, setTypeOverride, setUpdateStrategy, setUsedInOrderBy, setUseSchemaElement, setUsesImplData, setUsesIntermediate, setValueGenerated, setValueMappedBy, setValueSequenceName, setValueStrategy, setVersion, toString, usesImplData, usesIntermediateaddExtension, addExtension, copy, getBooleanExtension, getBooleanExtension, getDoubleExtension, getDoubleExtension, getEmbeddedExtensions, getEmbeddedExtensions, getExtensionKeys, getExtensionKeys, getExtensionVendors, getIntExtension, getIntExtension, getObjectExtension, getObjectExtension, getStringExtension, getStringExtension, hasExtension, hasExtension, isEmpty, removeEmbeddedExtensions, removeEmbeddedExtensions, removeExtension, removeExtension, validateExtensionKeysclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddEmbeddedMetaData, addEmbeddedMetaData, copy, getCascadeAttach, getCascadeDelete, getCascadeDetach, getCascadePersist, getCascadeRefresh, getDeclaredType, getDeclaredTypeCode, getDeclaredTypeMetaData, getEmbeddedMetaData, getFieldMetaData, getResolve, getType, getTypeCode, getTypeMetaData, getTypeOverride, getValueMappedBy, getValueMappedByMetaData, isDeclaredTypePC, isEmbedded, isEmbeddedPC, isSerialized, isTypePC, setCascadeAttach, setCascadeDelete, setCascadeDetach, setCascadePersist, setCascadePersist, setCascadeRefresh, setDeclaredType, setDeclaredTypeCode, setEmbedded, setResolve, setResolve, setSerialized, setType, setTypeCode, setTypeOverride, setValueMappedBygetRepositorypublic FieldMapping(String name, Class<?> type, ClassMapping owner)
public FieldMappingInfo getMappingInfo()
public FieldStrategy getStrategy()
public void setStrategy(FieldStrategy strategy, Boolean adapt)
adapt
parameter determines whether to adapt when mapping the strategy;
use null if the strategy should not be mapped.public Table getTable()
public ColumnIO getJoinColumnIO()
public void setJoinColumnIO(ColumnIO io)
public ForeignKey getJoinForeignKey()
public void setJoinForeignKey(ForeignKey fk)
public Unique getJoinUnique()
public void setJoinUnique(Unique unq)
public Unique[] getJoinTableUniques()
public void setJoinTableUniques(Unique[] unqs)
public Index getJoinIndex()
public void setJoinIndex(Index idx)
public boolean isJoinOuter()
public void setJoinOuter(boolean outer)
public Column getOrderColumn()
public void setOrderColumn(Column order)
public ColumnIO getOrderColumnIO()
public void setOrderColumnIO(ColumnIO io)
public void refSchemaComponents()
refSchemaComponents in interface ValueMappingpublic void clearMapping()
clearMapping in interface ValueMappingpublic void syncMappingInfo()
MappingInfo with our current mapping information.syncMappingInfo in interface ValueMappingpublic boolean isMapped()
isMapped in class FieldMetaDatapublic int getEagerFetchMode()
JDBCFetchConfiguration.public void setEagerFetchMode(int mode)
JDBCFetchConfiguration.public MappingRepository getMappingRepository()
FieldMetaData.getRepository()getMappingRepository in interface ValueMappingpublic ClassMapping getDefiningMapping()
FieldMetaData.getDefiningMetaData()public ClassMapping getDeclaringMapping()
FieldMetaData.getDeclaringMetaData()public ValueMapping getKeyMapping()
FieldMetaData.getKey()public ValueMapping getElementMapping()
FieldMetaData.getElement()public ValueMapping getValueMapping()
FieldMetaData.getValue()public FieldMapping getMappedByMapping()
FieldMetaData.getMappedByMetaData()public FieldMapping[] getInverseMappings()
FieldMetaData.getInverseMetaDatas()public boolean resolve(int mode)
FieldMetaDataresolve in interface ValueMetaDataresolve in class FieldMetaDatapublic void copyMappingInfo(FieldMapping fm)
public void copy(FieldMetaData fmd)
FieldMetaDatacopy in class FieldMetaDataprotected boolean validateDataStoreExtensionPrefix(String prefix)
ExtensionsvalidateDataStoreExtensionPrefix in class Extensionspublic String getAlias()
Strategypublic void map(boolean adapt)
Strategypublic void mapJoin(boolean adapt,
boolean joinRequired)
public void mapPrimaryKey(boolean adapt)
public void initialize()
StrategyStrategy.map(boolean), and after all related components have been
mapped as well.initialize in interface Strategypublic void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategyinsert in interface StrategySQLExceptionpublic void setMappedByIdValue(Object target, Object val, String mappedByIdFieldName)
public void update(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
Strategyupdate in interface StrategySQLExceptionStrategy.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
Strategydelete in interface StrategySQLExceptionStrategy.insert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore, org.apache.openjpa.jdbc.sql.RowManager)public void deleteRow(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException
SQLExceptionpublic Row getRow(OpenJPAStateManager sm, JDBCStore store, RowManager rm, int action) throws SQLException
SQLExceptionpublic Boolean isCustomInsert(OpenJPAStateManager sm, JDBCStore store)
StrategyBoolean.FALSE if this mapping does not customize the
insert process, Boolean.TRUE if it does, or null if it does
customize the insert, but also relies on the standard insert method
being called. Implement the Strategy.customInsert(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore) method
to implement the custom insertion behavior.isCustomInsert in interface Strategypublic Boolean isCustomUpdate(OpenJPAStateManager sm, JDBCStore store)
StrategyBoolean.FALSE if this mapping does not customize the
update process, Boolean.TRUE if it does, or null if it does
customize the update, but also relies on the standard update method
being called. Implement the Strategy.customUpdate(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore) method
to override the default update behavior.isCustomUpdate in interface Strategypublic Boolean isCustomDelete(OpenJPAStateManager sm, JDBCStore store)
StrategyBoolean.FALSE if this mapping does not customize the
delete process, Boolean.TRUE if it does, or null if it does
customize the delete, but also relies on the standard delete method
being called. Implement the Strategy.customDelete(org.apache.openjpa.kernel.OpenJPAStateManager, org.apache.openjpa.jdbc.kernel.JDBCStore) method
to override the default deletion behavior.isCustomDelete in interface Strategypublic void customInsert(OpenJPAStateManager sm, JDBCStore store) throws SQLException
StrategycustomInsert in interface StrategySQLExceptionpublic void customUpdate(OpenJPAStateManager sm, JDBCStore store) throws SQLException
StrategycustomUpdate in interface StrategySQLExceptionpublic void customDelete(OpenJPAStateManager sm, JDBCStore store) throws SQLException
StrategycustomDelete in interface StrategySQLExceptionpublic 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 selectEagerParallel(SelectExecutor sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode)
FieldStrategypublic void selectEagerJoin(Select 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 Joins join(Select sel)
public void wherePrimaryKey(Select sel, OpenJPAStateManager sm, JDBCStore store)
wherePrimaryKey or whereForeignKey
condition to the given select, depending on whether we have a join
foreign key.public void orderLocal(Select sel, ClassMapping elem, Joins joins)
elem - the related type we're fetching, or nulljoins - the joins to this field's tablepublic void orderRelation(Select sel, ClassMapping elem, Joins joins)
elem - the related type we're fetchingjoins - the joins across the relationpublic 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 Joins join(Joins joins, boolean forceOuter, boolean toMany)
public 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 FieldStrategySQLExceptionpublic ValueMappingInfo getValueInfo()
ValueMappinggetValueInfo in interface ValueMappingpublic ValueHandler getHandler()
ValueMappinggetHandler in interface ValueMappingpublic void setHandler(ValueHandler handler)
ValueMappingsetHandler in interface ValueMappingpublic FieldMapping getFieldMapping()
ValueMappingValueMetaData.getFieldMetaData().getFieldMapping in interface ValueMappingpublic ClassMapping getTypeMapping()
ValueMappingValueMetaData.getTypeMetaData().getTypeMapping in interface ValueMappingpublic ClassMapping getDeclaredTypeMapping()
ValueMappingValueMetaData.getDeclaredTypeMetaData().getDeclaredTypeMapping in interface ValueMappingpublic ClassMapping getEmbeddedMapping()
ValueMappingValueMetaData.getEmbeddedMetaData().getEmbeddedMapping in interface ValueMappingpublic FieldMapping getValueMappedByMapping()
ValueMappingValueMetaData.getValueMappedByMetaData().getValueMappedByMapping in interface ValueMappingpublic Column[] getColumns()
ValueMappinggetColumns in interface ValueMappingpublic void setColumns(Column[] cols)
ValueMappingsetColumns in interface ValueMappingpublic ColumnIO getColumnIO()
ValueMappinggetColumnIO in interface ValueMappingpublic void setColumnIO(ColumnIO io)
ValueMappingsetColumnIO in interface ValueMappingpublic ForeignKey getForeignKey()
ValueMappinggetForeignKey in interface ValueMappingpublic ForeignKey getForeignKey(ClassMapping target)
ValueMappinggetForeignKey in interface ValueMappingpublic void setForeignKey(ForeignKey fk)
ValueMappingsetForeignKey in interface ValueMappingpublic int getJoinDirection()
ValueMappinggetJoinDirection in interface ValueMappingpublic void setJoinDirection(int direction)
ValueMappingsetJoinDirection in interface ValueMappingpublic void setForeignKey(Row row, OpenJPAStateManager sm) throws SQLException
ValueMappingsetForeignKey in interface ValueMappingSQLExceptionpublic void setForeignKey(Row row, OpenJPAStateManager sm, int targetNumber) throws SQLException
ValueMappingsetForeignKey in interface ValueMappingSQLExceptionpublic void whereForeignKey(Row row, OpenJPAStateManager sm) throws SQLException
ValueMappingwhereForeignKey in interface ValueMappingSQLExceptionpublic ClassMapping[] getIndependentTypeMappings()
ValueMappinggetIndependentTypeMappings in interface ValueMappingpublic int getSelectSubclasses()
ValueMappingorg.apache.openjpa.sql.Select subclasses constant
for loading this relation, based on how the related type is mapped,
whether this relation is polymorphic, and whether it is configured to
use class criteria.getSelectSubclasses in interface ValueMappingpublic Unique getValueUnique()
ValueMappinggetValueUnique in interface ValueMappingpublic void setValueUnique(Unique unq)
ValueMappingsetValueUnique in interface ValueMappingpublic Index getValueIndex()
ValueMappinggetValueIndex in interface ValueMappingpublic void setValueIndex(Index idx)
ValueMappingsetValueIndex in interface ValueMappingpublic boolean getUseClassCriteria()
ValueMappinggetUseClassCriteria in interface ValueMappingpublic void setUseClassCriteria(boolean criteria)
ValueMappingsetUseClassCriteria in interface ValueMappingpublic int getPolymorphic()
ValueMappinggetPolymorphic in interface ValueMappingpublic void setPolymorphic(int poly)
ValueMappingsetPolymorphic in interface ValueMapping@Deprecated public void mapConstraints(String name, boolean adapt)
ValueMappingValueMappingInfo. The foreign key or columns of this value
must be set before calling this method.mapConstraints in interface ValueMappingpublic void mapConstraints(DBIdentifier name, boolean adapt)
ValueMappingValueMappingInfo. The foreign key or columns of this value
must be set before calling this method.mapConstraints in interface ValueMappingpublic void copyMappingInfo(ValueMapping vm)
ValueMappingcopyMappingInfo in interface ValueMappingpublic boolean isBidirectionalJoinTableMappingOwner()
public boolean isBidirectionalJoinTableMappingNonOwner()
public boolean isBiMTo1JT()
public boolean isUni1ToMFK()
public boolean isUniMTo1JT()
public boolean isUni1To1JT()
public boolean isBi1To1JT()
public FieldMapping getBi_1ToM_JTField()
public FieldMapping getBi_MTo1_JTField()
public ForeignKey getBi1ToMJoinFK()
public ForeignKey getBi1ToMElemFK()
public void setBi1MJoinTableInfo()
public boolean isNonDefaultMappingUsingJoinTableStrategy()
public void setMapsIdCols(boolean hasMapsIdCols)
public boolean hasMapsIdCols()
public boolean isDelayCapable()
isDelayCapable in class FieldMetaDataCopyright © 2006–2022 Apache Software Foundation. All rights reserved.