Class TypeConverterMultiMapping


  • public class TypeConverterMultiMapping
    extends SingleFieldMultiMapping
    Mapping where the member has its value converted to/from some storable datastore type using a TypeConverter to multiple columns.
    • Field Detail

      • converter

        org.datanucleus.store.types.converters.TypeConverter converter
    • Constructor Detail

      • TypeConverterMultiMapping

        public TypeConverterMultiMapping()
    • Method Detail

      • initialize

        public void initialize​(RDBMSStoreManager storeMgr,
                               java.lang.String type)
        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 class JavaTypeMapping
        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 class JavaTypeMapping
        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

        public java.lang.Class 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.
        The "java type" is the java-type name used in the plugin.xml mapping file
        Specified by:
        getJavaType in class JavaTypeMapping
        Returns:
        The java type
      • setObject

        public void setObject​(org.datanucleus.ExecutionContext ec,
                              java.sql.PreparedStatement ps,
                              int[] exprIndex,
                              java.lang.Object value)
        Description copied from class: JavaTypeMapping
        Sets a value into datastoreStatement at position specified by exprIndex.
        Overrides:
        setObject in class JavaTypeMapping
        Parameters:
        ec - ExecutionContext
        ps - PreparedStatement
        exprIndex - the position of the value in the statement
        value - the value
      • getObject

        public java.lang.Object getObject​(org.datanucleus.ExecutionContext ec,
                                          java.sql.ResultSet resultSet,
                                          int[] exprIndex)
        Description copied from class: JavaTypeMapping
        Obtains a value from datastoreResults at position specified by exprIndex.
        Overrides:
        getObject in class JavaTypeMapping
        Parameters:
        ec - ExecutionContext
        resultSet - ResultSet
        exprIndex - the position of the value in the result
        Returns:
        the value