Class 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 Detail

      • 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 Detail

      • MultiMapping

        public MultiMapping()
    • Method Detail

      • 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.
      • 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