Class SingleTableMultitenantPolicy

    • Field Detail

      • includeTenantCriteria

        protected boolean includeTenantCriteria
      • tenantDiscriminatorFields

        protected java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,​java.lang.String> tenantDiscriminatorFields
      • tenantDiscriminatorFieldsKeyedOnContext

        protected java.util.Map<java.lang.String,​java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>> tenantDiscriminatorFieldsKeyedOnContext
    • Constructor Detail

      • SingleTableMultitenantPolicy

        public SingleTableMultitenantPolicy​(ClassDescriptor desc)
    • Method Detail

      • addFieldsToRow

        public void addFieldsToRow​(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                   org.eclipse.persistence.internal.sessions.AbstractSession session)
        INTERNAL: Add the tenant discriminator fields to the row.
        Specified by:
        addFieldsToRow in interface MultitenantPolicy
      • addTenantDiscriminatorField

        public void addTenantDiscriminatorField​(java.lang.String property,
                                                org.eclipse.persistence.internal.helper.DatabaseField field)
        INTERNAL: Add a tenant discriminator field to the policy.
      • getTenantDiscriminatorFields

        public java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,​java.lang.String> getTenantDiscriminatorFields()
        INTERNAL:
      • getTenantDiscriminatorFieldsKeyedOnContext

        public java.util.Map<java.lang.String,​java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>> getTenantDiscriminatorFieldsKeyedOnContext()
        INTERNAL:
      • hasTenantDiscriminatorFields

        public boolean hasTenantDiscriminatorFields()
        INTERNAL: Return if this descriptor has specified some tenant discriminator fields.
      • initialize

        public void initialize​(org.eclipse.persistence.internal.sessions.AbstractSession session)
                        throws DescriptorException
        INTERNAL: Initialize the mappings as a separate step. This is done as a separate step to ensure that inheritance has been first resolved.
        Specified by:
        initialize in interface MultitenantPolicy
        Throws:
        DescriptorException
      • postInitialize

        public void postInitialize​(org.eclipse.persistence.internal.sessions.AbstractSession session)
        INTERNAL: Subclasses that need to add field to an expresison should override this method.
        Specified by:
        postInitialize in interface MultitenantPolicy
      • setDescriptor

        public void setDescriptor​(ClassDescriptor descriptor)
        INTERNAL:
      • setIncludeTenantCriteria

        public void setIncludeTenantCriteria​(boolean includeTenantCriteria)
        ADVANCED: Boolean used to indicate if the database requires the tenant criteria to be added to the SELECT, UPDATE, and DELETE queries. By default this is done but when set to false the queries will not be modified and it will be up to the application or database to ensure that the correct criteria is applied to all queries.
        See Also:
        Multitenant
      • setTenantDiscriminatorFields

        public void setTenantDiscriminatorFields​(java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,​java.lang.String> tenantDiscriminatorFields)
        INTERNAL: