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 Details

    • javaTypeMappings

      protected JavaTypeMapping[] javaTypeMappings
      The Java mappings represented by this mapping.
    • numberOfColumnMappings

      protected int numberOfColumnMappings
      Number of column mappings - for convenience to improve performance
  • Constructor Details

    • MultiMapping

      public MultiMapping()
  • Method Details

    • 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 class JavaTypeMapping
      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 class JavaTypeMapping
      Returns:
      The column mapping(s)
    • getColumnMapping

      public ColumnMapping getColumnMapping(int index)
      Accessor for a datastore mapping.
      Overrides:
      getColumnMapping in class JavaTypeMapping
      Parameters:
      index - The position of the mapping to return
      Returns:
      The datastore mapping