Class VersionMapping
- java.lang.Object
-
- org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping
-
- org.datanucleus.store.rdbms.mapping.java.SingleFieldMapping
-
- org.datanucleus.store.rdbms.mapping.java.VersionMapping
-
- Direct Known Subclasses:
VersionMapping.VersionLongMapping,VersionMapping.VersionTimestampMapping
public class VersionMapping extends SingleFieldMapping
Mapping class for mapping version state/timestamp columns in the database. This class is for internal use only. It should not be used in user mappings.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVersionMapping.VersionLongMappingVersion using a Long delegate.static classVersionMapping.VersionTimestampMappingVersion using a Timestamp delegate.
-
Field Summary
-
Fields inherited from class org.datanucleus.store.rdbms.mapping.java.SingleFieldMapping
EXTENSION_CHECK_CONSTRAINT_VALUES
-
Fields inherited from class org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping
absFieldNumber, columnMappings, mmd, referenceMapping, roleForMember, storeMgr, table, type
-
-
Constructor Summary
Constructors Constructor Description VersionMapping(Table table, JavaTypeMapping delegate)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColumnMapping(ColumnMapping colMapping)Method to add a column mapping.ColumnMappinggetColumnMapping(int index)Accessor for a datastore mapping.ColumnMapping[]getColumnMappings()Accessor for the datastore mappings for this java type.ClassgetJavaType()Accessor for the type represented here, returning the class itselfintgetNumberOfColumnMappings()Accessor for the number of columns.ObjectgetObject(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)Accessor for the object in this columnbooleanincludeInFetchStatement()Accessor for whether to include this column in any fetch statementvoidsetObject(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, Object value)Mutator for the object in this column-
Methods inherited from class org.datanucleus.store.rdbms.mapping.java.SingleFieldMapping
getBoolean, getByte, getChar, getDefaultLength, getDouble, getFloat, getInt, getJavaTypeForColumnMapping, getLong, getShort, getString, getValidValues, initialize, prepareColumnMapping, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, setString
-
Methods inherited from class org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping
equals, failureMessage, getAbsoluteFieldNumber, getColumnMetaDataForMember, getMemberMetaData, getObject, getReferenceMapping, getRoleForMember, getStoreManager, getTable, getType, getValueForColumnMapping, hashCode, hasSimpleDatastoreRepresentation, includeInInsertStatement, includeInUpdateStatement, initialize, insertPostProcessing, isNullable, isSerialised, representableAsStringLiteralInStatement, requiresInsertPostProcessing, requiresUpdatePostProcessing, setAbsFieldNumber, setMemberMetaData, setObject, setReferenceMapping, setRoleForMember, setTable, updatePostProcessing
-
-
-
-
Constructor Detail
-
VersionMapping
public VersionMapping(Table table, JavaTypeMapping delegate)
Constructor.- Parameters:
table- Datastore tabledelegate- The JavaTypeMapping to delegate the storage
-
-
Method Detail
-
includeInFetchStatement
public boolean includeInFetchStatement()
Accessor for whether to include this column in any fetch statement- Overrides:
includeInFetchStatementin classJavaTypeMapping- Returns:
- Whether to include the column when fetching.
-
getNumberOfColumnMappings
public int getNumberOfColumnMappings()
Accessor for the number of columns.- Overrides:
getNumberOfColumnMappingsin classJavaTypeMapping- Returns:
- Number of columns.
-
getColumnMapping
public ColumnMapping getColumnMapping(int index)
Accessor for a datastore mapping.- Overrides:
getColumnMappingin classJavaTypeMapping- Parameters:
index- The mapping index- Returns:
- the datastore mapping
-
getColumnMappings
public ColumnMapping[] getColumnMappings()
Accessor for the datastore mappings for this java type.- Overrides:
getColumnMappingsin classJavaTypeMapping- Returns:
- The datastore mapping(s)
-
addColumnMapping
public void addColumnMapping(ColumnMapping colMapping)
Method to add a column mapping.- Overrides:
addColumnMappingin classJavaTypeMapping- Parameters:
colMapping- The mapping
-
getJavaType
public Class getJavaType()
Accessor for the type represented here, returning the class itself- Specified by:
getJavaTypein classJavaTypeMapping- Returns:
- This class.
-
setObject
public void setObject(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, Object value)Mutator for the object in this column- Overrides:
setObjectin classSingleFieldMapping- Parameters:
ec- execution contextps- The statementexprIndex- The indexesvalue- The value to set it to
-
getObject
public Object getObject(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
Accessor for the object in this column- Overrides:
getObjectin classSingleFieldMapping- Parameters:
ec- execution contextresultSet- The ResultSet to get the value fromexprIndex- The indexes- Returns:
- The object
-
-