EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.descriptors
Class SingleTableMultitenantPolicy

java.lang.Object
  extended by org.eclipse.persistence.descriptors.SingleTableMultitenantPolicy
All Implemented Interfaces:
MultitenantPolicy
Direct Known Subclasses:
VPDMultitenantPolicy

public class SingleTableMultitenantPolicy
extends java.lang.Object
implements MultitenantPolicy

A single table "striped" multitenant policy.

Author:
Guy Pelletier
Since:
EclipseLink 2.3.1

Field Summary
protected  ClassDescriptor descriptor
           
protected  boolean includeTenantCriteria
           
protected  java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,java.lang.String> tenantDiscriminatorFields
           
protected  java.util.Map<java.lang.String,java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>> tenantDiscriminatorFieldsKeyedOnContext
           
 
Constructor Summary
SingleTableMultitenantPolicy(ClassDescriptor desc)
           
 
Method Summary
 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.
 void addTenantDiscriminatorField(java.lang.String property, org.eclipse.persistence.internal.helper.DatabaseField field)
          INTERNAL: Add a tenant discriminator field to the policy.
 void addToTableDefinition(TableDefinition tableDefinition)
          INTERNAL:
 MultitenantPolicy clone(ClassDescriptor descriptor)
          INTERNAL:
 ClassDescriptor getDescriptor()
          INTERNAL:
 java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,java.lang.String> getTenantDiscriminatorFields()
          INTERNAL:
 java.util.Map<java.lang.String,java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>> getTenantDiscriminatorFieldsKeyedOnContext()
          INTERNAL:
 boolean hasTenantDiscriminatorFields()
          INTERNAL: Return if this descriptor has specified some tenant discriminator fields.
 void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Initialize the mappings as a separate step.
 boolean isSingleTableMultitenantPolicy()
          INTERNAL:
 boolean isTablePerMultitenantPolicy()
          INTERNAL:
 void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Subclasses that need to add field to an expresison should override this method.
 void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Allow the descriptor to initialize any dependencies on this session.
 void setDescriptor(ClassDescriptor descriptor)
          INTERNAL:
 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.
 void setTenantDiscriminatorFields(java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,java.lang.String> tenantDiscriminatorFields)
          INTERNAL:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

includeTenantCriteria

protected boolean includeTenantCriteria

descriptor

protected ClassDescriptor descriptor

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

addToTableDefinition

public void addToTableDefinition(TableDefinition tableDefinition)
INTERNAL:

Specified by:
addToTableDefinition in interface MultitenantPolicy

clone

public MultitenantPolicy clone(ClassDescriptor descriptor)
INTERNAL:

Specified by:
clone in interface MultitenantPolicy

getDescriptor

public ClassDescriptor getDescriptor()
INTERNAL:


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

isSingleTableMultitenantPolicy

public boolean isSingleTableMultitenantPolicy()
INTERNAL:

Specified by:
isSingleTableMultitenantPolicy in interface MultitenantPolicy

isTablePerMultitenantPolicy

public boolean isTablePerMultitenantPolicy()
INTERNAL:

Specified by:
isTablePerMultitenantPolicy in interface MultitenantPolicy

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

preInitialize

public void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
                   throws DescriptorException
INTERNAL: Allow the descriptor to initialize any dependencies on this session.

Specified by:
preInitialize in interface MultitenantPolicy
Throws:
DescriptorException

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:


EclipseLink 2.4.2, build 'v20130514-5956486' API Reference