Class MultiMapping
- java.lang.Object
-
- org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping
-
- org.datanucleus.store.rdbms.mapping.java.MultiMapping
-
- Direct Known Subclasses:
MultiPersistableMapping
,PersistableMapping
public abstract class MultiMapping extends JavaTypeMapping
Mapping to represent multiple mappings within the single overall java type mapping. This mapping can be used to represent, for example,- a persistable field (where there are multiple PK fields).
- a reference field (where there are multiple implementations - of Object or interface)
- an element in a collection and the element has no table of its own, but multiple subclasses
- a FK of a PC field (where there may be multiple fields in the PK of the PC object)
-
-
Field Summary
Fields Modifier and Type Field Description protected JavaTypeMapping[]
javaTypeMappings
The Java mappings represented by this mapping.protected int
numberOfColumnMappings
Number of column mappings - for convenience to improve performance-
Fields inherited from class org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping
absFieldNumber, columnMappings, mmd, referenceMapping, roleForMember, storeMgr, table, type
-
-
Constructor Summary
Constructors Constructor Description MultiMapping()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addJavaTypeMapping(JavaTypeMapping mapping)
Method to add a Java type mapping for a fieldColumnMapping
getColumnMapping(int index)
Accessor for a datastore mapping.ColumnMapping[]
getColumnMappings()
Accessor for the column mappings for this java typeJavaTypeMapping[]
getJavaTypeMapping()
Accessor for the Java type mappingsint
getNumberOfColumnMappings()
Accessor for the number of datastore mappings.-
Methods inherited from class org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping
addColumnMapping, equals, failureMessage, getAbsoluteFieldNumber, getBoolean, getByte, getChar, getColumnMetaDataForMember, getDouble, getFloat, getInt, getJavaType, getJavaTypeForColumnMapping, getLong, getMemberMetaData, getObject, getObject, getReferenceMapping, getRoleForMember, getShort, getStoreManager, getString, getTable, getType, getValueForColumnMapping, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, initialize, isNullable, isSerialised, performSetPostProcessing, representableAsStringLiteralInStatement, requiresSetPostProcessing, setAbsFieldNumber, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setMemberMetaData, setObject, setObject, setReferenceMapping, setRoleForMember, setShort, setString, setTable
-
-
-
-
Field Detail
-
javaTypeMappings
protected JavaTypeMapping[] javaTypeMappings
The Java mappings represented by this mapping.
-
numberOfColumnMappings
protected int numberOfColumnMappings
Number of column mappings - for convenience to improve performance
-
-
Method Detail
-
addJavaTypeMapping
public void addJavaTypeMapping(JavaTypeMapping mapping)
Method to add a Java type mapping for a field- Parameters:
mapping
- The mapping to add
-
getJavaTypeMapping
public JavaTypeMapping[] getJavaTypeMapping()
Accessor for the Java type mappings- Returns:
- The Java type mappings
-
getNumberOfColumnMappings
public int getNumberOfColumnMappings()
Accessor for the number of datastore mappings.- Overrides:
getNumberOfColumnMappings
in classJavaTypeMapping
- Returns:
- The number of datastore mappings.
-
getColumnMappings
public ColumnMapping[] getColumnMappings()
Description copied from class:JavaTypeMapping
Accessor for the column mappings for this java type- Overrides:
getColumnMappings
in classJavaTypeMapping
- Returns:
- The column mapping(s)
-
getColumnMapping
public ColumnMapping getColumnMapping(int index)
Accessor for a datastore mapping.- Overrides:
getColumnMapping
in classJavaTypeMapping
- Parameters:
index
- The position of the mapping to return- Returns:
- The datastore mapping
-
-