Class PersistenceMappingDefaults

    • Constructor Detail

      • PersistenceMappingDefaults

        public PersistenceMappingDefaults()
    • Method Detail

      • getPrependFieldNameToJoinTableInverseJoinColumns

        public boolean getPrependFieldNameToJoinTableInverseJoinColumns()
        Whether to prepend the field name to the default name of inverse join columns within join tables. Defaults to true per spec, but set to false for compatibility with older versions of OpenJPA.
      • setPrependFieldNameToJoinTableInverseJoinColumns

        public void setPrependFieldNameToJoinTableInverseJoinColumns​(boolean val)
        Whether to prepend the field name to the default name of inverse join columns within join tables. Defaults to true per spec, but set to false for compatibility with older versions of OpenJPA.
      • getStrategy

        public java.lang.Object getStrategy​(Version vers,
                                            boolean adapt)
        Description copied from interface: MappingDefaults
        Default version mapping strategy when there is no explicit strategy.
        Specified by:
        getStrategy in interface MappingDefaults
        Overrides:
        getStrategy in class MappingDefaultsImpl
        Parameters:
        vers - the version; will not be mapped, but raw MappingInfo will be available
        adapt - whether we can adapt the mapping or schema
        Returns:
        the strategy alias or a strategy instance, or null
      • getStrategy

        public java.lang.Object getStrategy​(Discriminator disc,
                                            boolean adapt)
        Description copied from interface: MappingDefaults
        Default discriminator mapping strategy when there is no explicit strategy.
        Specified by:
        getStrategy in interface MappingDefaults
        Overrides:
        getStrategy in class MappingDefaultsImpl
        Parameters:
        disc - the discriminator; will not be mapped, but raw MappingInfo will be available
        adapt - whether we can adapt the mapping or schema
        Returns:
        the strategy alias or a strategy instance, or null
      • populateJoinColumn

        public void populateJoinColumn​(FieldMapping fm,
                                       Table local,
                                       Table foreign,
                                       Column col,
                                       java.lang.Object target,
                                       int pos,
                                       int cols)
        Description copied from interface: MappingDefaults
        Fill in default information for the given column used to join a field to its defining class' table. The column will be a clone of the target column, or have its name and Java type set in the case of a constant target.
        Specified by:
        populateJoinColumn in interface MappingDefaults
        Overrides:
        populateJoinColumn in class MappingDefaultsImpl
        target - the target of this column in the join; may be another column or a constant value
        pos - the index of this column in the logical foreign key
        cols - the number of columns in the logical foreign key
      • populateForeignKeyColumn

        public void populateForeignKeyColumn​(ValueMapping vm,
                                             java.lang.String name,
                                             Table local,
                                             Table foreign,
                                             Column col,
                                             java.lang.Object target,
                                             boolean inverse,
                                             int pos,
                                             int cols)
        Description copied from interface: MappingDefaults
        Fill in default information for the given column used to join a value to its related type. The column will be a clone of the target column, or have its name and Java type set in the case of a constant target.
        Specified by:
        populateForeignKeyColumn in interface MappingDefaults
        Overrides:
        populateForeignKeyColumn in class MappingDefaultsImpl
        name - base name for value, as decided by mapping
        target - the target of this column in the join; may be another column or a constant value
        inverse - whether this is an inverse foreign key
        pos - the index of this column in the logical foreign key
        cols - the number of columns in the logical foreign key
      • populateForeignKeyColumn

        public void populateForeignKeyColumn​(ValueMapping vm,
                                             DBIdentifier sName,
                                             Table local,
                                             Table foreign,
                                             Column col,
                                             java.lang.Object target,
                                             boolean inverse,
                                             int pos,
                                             int cols)
        Description copied from interface: MappingDefaults
        Fill in default information for the given column used to join a value to its related type. The column will be a clone of the target column, or have its name and Java type set in the case of a constant target.
        Specified by:
        populateForeignKeyColumn in interface MappingDefaults
        Overrides:
        populateForeignKeyColumn in class MappingDefaultsImpl
        sName - base name for value, as decided by mapping
        target - the target of this column in the join; may be another column or a constant value
        inverse - whether this is an inverse foreign key
        pos - the index of this column in the logical foreign key
        cols - the number of columns in the logical foreign key