public class ValueMappingImpl extends ValueMetaDataImpl implements ValueMapping
ValueMapping
implementation.JOIN_EXPECTED_INVERSE, JOIN_FORWARD, JOIN_INVERSE, POLY_FALSE, POLY_JOINABLE, POLY_TRUE
CASCADE_AUTO, CASCADE_IMMEDIATE, CASCADE_NONE, MAPPED_BY_PK
MODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY
Modifier | Constructor and Description |
---|---|
protected |
ValueMappingImpl()
Constructor for deserialization.
|
|
ValueMappingImpl(FieldMapping owner)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clearMapping()
Clear mapping information, including strategy.
|
void |
copy(ValueMetaData vmd)
Copy state from the given value to this one.
|
void |
copyMappingInfo(ValueMapping vm)
Copy mapping info from the given instance to this one.
|
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 |
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.
|
ForeignKey |
getForeignKey(ClassMapping target,
int targetNumber) |
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.
|
int |
getJoinDirection()
The join direction.
|
MappingRepository |
getMappingRepository()
Convenience method to perform cast from
MetaDataContext.getRepository() . |
int |
getPolymorphic()
The degree to which this relation is polymorphic.
|
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. |
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() . |
Unique |
getValueUnique()
Unique constraint on this value's columns, or null if none.
|
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 |
refSchemaComponents()
Increase the reference count on used schema components.
|
boolean |
resolve(int mode)
Resolve and validate metadata.
|
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 |
setForeignKey(ForeignKey fk)
If this value joins to another record, the foreign key.
|
void |
setForeignKey(Row row,
OpenJPAStateManager rel)
Sets this value's foreign key to the given related object.
|
void |
setForeignKey(Row row,
OpenJPAStateManager rel,
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 |
setJoinDirection(int direction)
The join direction.
|
void |
setPolymorphic(int poly)
The degree to which this relation is polymorphic.
|
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.
|
void |
syncMappingInfo()
Update
MappingInfo with our current mapping information. |
void |
whereForeignKey(Row row,
OpenJPAStateManager rel)
Sets this value's foreign key to the given related object.
|
addEmbeddedMetaData, addEmbeddedMetaData, getCascadeAttach, getCascadeDelete, getCascadeDetach, getCascadePersist, getCascadeRefresh, getDeclaredType, getDeclaredTypeCode, getDeclaredTypeMetaData, getEmbeddedMetaData, getFieldMetaData, getRepository, 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, setValueMappedBy, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addEmbeddedMetaData, addEmbeddedMetaData, 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, setValueMappedBy
getRepository
public ValueMappingImpl(FieldMapping owner)
protected ValueMappingImpl()
public ValueMappingInfo getValueInfo()
ValueMapping
getValueInfo
in interface ValueMapping
public ValueHandler getHandler()
ValueMapping
getHandler
in interface ValueMapping
public void setHandler(ValueHandler handler)
ValueMapping
setHandler
in interface ValueMapping
public MappingRepository getMappingRepository()
ValueMapping
MetaDataContext.getRepository()
.getMappingRepository
in interface ValueMapping
public FieldMapping getFieldMapping()
ValueMapping
ValueMetaData.getFieldMetaData()
.getFieldMapping
in interface ValueMapping
public ClassMapping getTypeMapping()
ValueMapping
ValueMetaData.getTypeMetaData()
.getTypeMapping
in interface ValueMapping
public ClassMapping getDeclaredTypeMapping()
ValueMapping
ValueMetaData.getDeclaredTypeMetaData()
.getDeclaredTypeMapping
in interface ValueMapping
public ClassMapping getEmbeddedMapping()
ValueMapping
ValueMetaData.getEmbeddedMetaData()
.getEmbeddedMapping
in interface ValueMapping
public FieldMapping getValueMappedByMapping()
ValueMapping
ValueMetaData.getValueMappedByMetaData()
.getValueMappedByMapping
in interface ValueMapping
public Column[] getColumns()
ValueMapping
getColumns
in interface ValueMapping
public void setColumns(Column[] cols)
ValueMapping
setColumns
in interface ValueMapping
public ColumnIO getColumnIO()
ValueMapping
getColumnIO
in interface ValueMapping
public void setColumnIO(ColumnIO io)
ValueMapping
setColumnIO
in interface ValueMapping
public ForeignKey getForeignKey()
ValueMapping
getForeignKey
in interface ValueMapping
public void setForeignKey(ForeignKey fk)
ValueMapping
setForeignKey
in interface ValueMapping
public ForeignKey getForeignKey(ClassMapping target, int targetNumber)
public ForeignKey getForeignKey(ClassMapping target)
ValueMapping
getForeignKey
in interface ValueMapping
public int getJoinDirection()
ValueMapping
getJoinDirection
in interface ValueMapping
public void setJoinDirection(int direction)
ValueMapping
setJoinDirection
in interface ValueMapping
public void setForeignKey(Row row, OpenJPAStateManager rel, int targetNumber) throws SQLException
ValueMapping
setForeignKey
in interface ValueMapping
SQLException
public void setForeignKey(Row row, OpenJPAStateManager rel) throws SQLException
ValueMapping
setForeignKey
in interface ValueMapping
SQLException
public void whereForeignKey(Row row, OpenJPAStateManager rel) throws SQLException
ValueMapping
whereForeignKey
in interface ValueMapping
SQLException
public ClassMapping[] getIndependentTypeMappings()
ValueMapping
getIndependentTypeMappings
in interface ValueMapping
public int getSelectSubclasses()
ValueMapping
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.getSelectSubclasses
in interface ValueMapping
public Unique getValueUnique()
ValueMapping
getValueUnique
in interface ValueMapping
public void setValueUnique(Unique unq)
ValueMapping
setValueUnique
in interface ValueMapping
public Index getValueIndex()
ValueMapping
getValueIndex
in interface ValueMapping
public void setValueIndex(Index idx)
ValueMapping
setValueIndex
in interface ValueMapping
public boolean getUseClassCriteria()
ValueMapping
getUseClassCriteria
in interface ValueMapping
public void setUseClassCriteria(boolean criteria)
ValueMapping
setUseClassCriteria
in interface ValueMapping
public int getPolymorphic()
ValueMapping
getPolymorphic
in interface ValueMapping
public void setPolymorphic(int poly)
ValueMapping
setPolymorphic
in interface ValueMapping
public void refSchemaComponents()
ValueMapping
refSchemaComponents
in interface ValueMapping
@Deprecated public void mapConstraints(String name, boolean adapt)
ValueMapping
ValueMappingInfo
. The foreign key or columns of this value
must be set before calling this method.mapConstraints
in interface ValueMapping
public void mapConstraints(DBIdentifier name, boolean adapt)
ValueMapping
ValueMappingInfo
. The foreign key or columns of this value
must be set before calling this method.mapConstraints
in interface ValueMapping
public void clearMapping()
ValueMapping
clearMapping
in interface ValueMapping
public void syncMappingInfo()
ValueMapping
MappingInfo
with our current mapping information.syncMappingInfo
in interface ValueMapping
public void copy(ValueMetaData vmd)
ValueMetaData
copy
in interface ValueMetaData
copy
in class ValueMetaDataImpl
public void copyMappingInfo(ValueMapping vm)
ValueMapping
copyMappingInfo
in interface ValueMapping
public boolean resolve(int mode)
ValueMetaData
resolve
in interface ValueMetaData
resolve
in class ValueMetaDataImpl
Copyright © 2006–2019 Apache Software Foundation. All rights reserved.