Interface MappingManager

  • All Known Implementing Classes:
    MappingManagerImpl, OracleMappingManagerImpl

    public interface MappingManager
    Representation of a MappingManager, mapping a java mapping type to a column mapping type. Allows a java mapping type to map to multiple column mapping types. Allows a default column mapping type be assigned to each java mapping type.
    • Method Detail

      • isSupportedMappedType

        boolean isSupportedMappedType​(String javaTypeName)
        Accessor for whether a java type is supported as being mappable.
        Parameters:
        javaTypeName - The java type name
        Returns:
        Whether the class is supported (to some degree)
      • getMappingType

        Class<? extends JavaTypeMapping> getMappingType​(String javaTypeName)
        Accessor for the JavaTypeMapping class for the supplied java type.
        Parameters:
        javaTypeName - The java type name
        Returns:
        The JavaTypeMapping class to use
      • createColumnMapping

        ColumnMapping createColumnMapping​(JavaTypeMapping mapping,
                                          org.datanucleus.metadata.AbstractMemberMetaData fmd,
                                          int index,
                                          Column column)
        Method to create the column mapping for a java type mapping at a particular index.
        Parameters:
        mapping - The java mapping
        fmd - MetaData for the field
        index - Index of the column
        column - The column
        Returns:
        The column mapping
      • createColumnMapping

        ColumnMapping createColumnMapping​(JavaTypeMapping mapping,
                                          Column column,
                                          String javaType)
        Method to create the column mapping for a particular column and java type.
        Parameters:
        mapping - The java mapping
        column - The column
        javaType - The java type (isn't this stored in the java mapping ?)
        Returns:
        The column mapping
      • getMapping

        JavaTypeMapping getMapping​(Class javaType)
        Accessor for a mapping, for a java type. Same as calling "getMapping(c, false, false, (String)null);"
        Parameters:
        javaType - The java type
        Returns:
        The mapping
      • getMapping

        JavaTypeMapping getMapping​(Class javaType,
                                   boolean serialised,
                                   boolean embedded,
                                   String fieldName)
        Accessor for a mapping, for a java type.
        Parameters:
        javaType - The java type
        serialised - Whether the type is serialised
        embedded - Whether the type is embedded
        fieldName - Name of the field (for logging only)
        Returns:
        The mapping
      • getMappingWithColumnMapping

        JavaTypeMapping getMappingWithColumnMapping​(Class javaType,
                                                    boolean serialised,
                                                    boolean embedded,
                                                    org.datanucleus.ClassLoaderResolver clr)
        Accessor for a mapping, for a java type complete with the column mapping.
        Parameters:
        javaType - The java type
        serialised - Whether the type is serialised
        embedded - Whether the type is embedded
        clr - ClassLoader resolver
        Returns:
        The mapping
      • getMapping

        JavaTypeMapping getMapping​(Table table,
                                   org.datanucleus.metadata.AbstractMemberMetaData mmd,
                                   org.datanucleus.ClassLoaderResolver clr,
                                   org.datanucleus.metadata.FieldRole fieldRole)
        Accessor for the mapping for the field of the specified table. Can be used for fields of a class, elements of a collection of a class, elements of an array of a class, keys of a map of a class, values of a map of a class. This is controlled by the final argument "roleForMember".
        Parameters:
        table - Table to add the mapping to
        mmd - MetaData for the field/property to map
        clr - The ClassLoaderResolver
        fieldRole - Role that this mapping plays for the field/property
        Returns:
        The mapping for the field.
      • createColumn

        Column createColumn​(JavaTypeMapping mapping,
                            String javaType,
                            int datastoreFieldIndex)
        Method to create a column in a container (table).
        Parameters:
        mapping - The java mapping
        javaType - The java type
        datastoreFieldIndex - The index of the column to create
        Returns:
        The column
      • createColumn

        Column createColumn​(JavaTypeMapping mapping,
                            String javaType,
                            org.datanucleus.metadata.ColumnMetaData colmd)
        Method to create a column in a container (table). To be used for serialised PC element/key/value in a join table.
        Parameters:
        mapping - The java mapping
        javaType - The java type
        colmd - MetaData for the column to create
        Returns:
        The column
      • createColumn

        Column createColumn​(org.datanucleus.metadata.AbstractMemberMetaData fmd,
                            Table table,
                            JavaTypeMapping mapping,
                            org.datanucleus.metadata.ColumnMetaData colmd,
                            Column referenceCol,
                            org.datanucleus.ClassLoaderResolver clr)
        Method to create a column for a persistable mapping.
        Parameters:
        fmd - MetaData for the field
        table - Table in the datastore
        mapping - The java mapping
        colmd - MetaData for the column to create
        referenceCol - The column to reference
        clr - ClassLoader resolver
        Returns:
        The column