Class TypeConverterMultiMapping
java.lang.Object
org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping
org.datanucleus.store.rdbms.mapping.java.SingleFieldMultiMapping
org.datanucleus.store.rdbms.mapping.java.TypeConverterMultiMapping
Mapping where the member has its value converted to/from some storable datastore type using a TypeConverter to multiple columns.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) org.datanucleus.store.types.converters.TypeConverter
Fields inherited from class org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping
absFieldNumber, columnMappings, mmd, referenceMapping, roleForMember, storeMgr, table, type
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAccessor for the java type being mapped.Obtains a value fromdatastoreResults
at position specified byexprIndex
.org.datanucleus.store.types.converters.TypeConverter
void
initialize
(org.datanucleus.metadata.AbstractMemberMetaData mmd, Table table, org.datanucleus.ClassLoaderResolver clr) Initialize this JavaTypeMapping for the supplied table and field/property metadata.void
initialize
(org.datanucleus.metadata.AbstractMemberMetaData mmd, Table table, org.datanucleus.ClassLoaderResolver clr, org.datanucleus.store.types.converters.TypeConverter conv) void
initialize
(RDBMSStoreManager storeMgr, String type) Initialise this JavaTypeMapping with the given StoreManager for the given type.void
setObject
(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, Object value) Sets avalue
intodatastoreStatement
at position specified byexprIndex
.Methods inherited from class org.datanucleus.store.rdbms.mapping.java.SingleFieldMultiMapping
addColumns, getJavaTypeForColumnMapping, hasSimpleDatastoreRepresentation
Methods inherited from class org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping
addColumnMapping, equals, failureMessage, getAbsoluteFieldNumber, getBoolean, getByte, getChar, getColumnMapping, getColumnMappings, getColumnMetaDataForMember, getDouble, getFloat, getInt, getLong, getMemberMetaData, getNumberOfColumnMappings, getObject, getReferenceMapping, getRoleForMember, getShort, getStoreManager, getString, getTable, getType, getValueForColumnMapping, hashCode, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, isNullable, isSerialised, performSetPostProcessing, representableAsStringLiteralInStatement, requiresSetPostProcessing, setAbsFieldNumber, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setMemberMetaData, setObject, setReferenceMapping, setRoleForMember, setShort, setString, setTable
-
Field Details
-
converter
org.datanucleus.store.types.converters.TypeConverter converter
-
-
Constructor Details
-
TypeConverterMultiMapping
public TypeConverterMultiMapping()
-
-
Method Details
-
initialize
Description copied from class:JavaTypeMapping
Initialise this JavaTypeMapping with the given StoreManager for the given type. Used when the mapping is for a parameter in a query. This will not set the "mmd" and "datastoreContainer" parameters. If these are required for usage of the mapping then you should call setFieldInformation(AbstractMemberMetaData, DatastoreContainerObject) below. Subclasses should override this method to perform any datastore initialization operations.- Overrides:
initialize
in classJavaTypeMapping
- Parameters:
storeMgr
- The Datastore Adapter that this Mapping should use.type
- The Class that this mapping maps to the database.
-
initialize
public void initialize(org.datanucleus.metadata.AbstractMemberMetaData mmd, Table table, org.datanucleus.ClassLoaderResolver clr) Description copied from class:JavaTypeMapping
Initialize this JavaTypeMapping for the supplied table and field/property metadata. Subclasses should override this method to perform any datastore initialization operations. Assumes the "roleForMember" is already set- Overrides:
initialize
in classJavaTypeMapping
- Parameters:
mmd
- MetaData for the field/property to be mapped (if any)table
- The table storing this mapping (if any)clr
- the ClassLoaderResolver
-
initialize
public void initialize(org.datanucleus.metadata.AbstractMemberMetaData mmd, Table table, org.datanucleus.ClassLoaderResolver clr, org.datanucleus.store.types.converters.TypeConverter conv) -
getTypeConverter
public org.datanucleus.store.types.converters.TypeConverter getTypeConverter() -
getJavaType
Description copied from class:JavaTypeMapping
Accessor for the java type being mapped. This is the java type that the mapping represents. Some examples :- if the field is of type "MyClass" then the mapping will be OIDMapping (or subclass) the javaType will be OID, and the type will be MyClass.
- if the field is of type "int" then the mapping will be IntegerMapping, the javaType will be Integer, and the type will be int.
- Specified by:
getJavaType
in classJavaTypeMapping
- Returns:
- The java type
-
setObject
public void setObject(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, Object value) Description copied from class:JavaTypeMapping
Sets avalue
intodatastoreStatement
at position specified byexprIndex
.- Overrides:
setObject
in classJavaTypeMapping
- Parameters:
ec
- ExecutionContextps
- PreparedStatementexprIndex
- the position of the value in the statementvalue
- the value
-
getObject
Description copied from class:JavaTypeMapping
Obtains a value fromdatastoreResults
at position specified byexprIndex
.- Overrides:
getObject
in classJavaTypeMapping
- Parameters:
ec
- ExecutionContextresultSet
- ResultSetexprIndex
- the position of the value in the result- Returns:
- the value
-