Class SingleTableMultitenantPolicy
- java.lang.Object
-
- org.eclipse.persistence.descriptors.SingleTableMultitenantPolicy
-
- All Implemented Interfaces:
java.io.Serializable
,MultitenantPolicy
- Direct Known Subclasses:
VPDMultitenantPolicy
public class SingleTableMultitenantPolicy extends java.lang.Object implements MultitenantPolicy
A single table "striped" multitenant policy.- See Also:
- Serialized Form
- Author:
- Guy Pelletier
- Since:
- EclipseLink 2.3.1
-
-
Field Summary
Fields Modifier and Type Field Description 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
Constructors Constructor Description SingleTableMultitenantPolicy(ClassDescriptor desc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
isSchemaPerMultitenantPolicy()
INTERNAL: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:
-
-
-
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 interfaceMultitenantPolicy
-
addToTableDefinition
public void addToTableDefinition(TableDefinition tableDefinition)
INTERNAL:- Specified by:
addToTableDefinition
in interfaceMultitenantPolicy
-
clone
public MultitenantPolicy clone(ClassDescriptor descriptor)
INTERNAL:- Specified by:
clone
in interfaceMultitenantPolicy
-
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 interfaceMultitenantPolicy
- Throws:
DescriptorException
-
isSingleTableMultitenantPolicy
public boolean isSingleTableMultitenantPolicy()
INTERNAL:- Specified by:
isSingleTableMultitenantPolicy
in interfaceMultitenantPolicy
-
isTablePerMultitenantPolicy
public boolean isTablePerMultitenantPolicy()
INTERNAL:- Specified by:
isTablePerMultitenantPolicy
in interfaceMultitenantPolicy
-
isSchemaPerMultitenantPolicy
public boolean isSchemaPerMultitenantPolicy()
INTERNAL:- Specified by:
isSchemaPerMultitenantPolicy
in interfaceMultitenantPolicy
-
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 interfaceMultitenantPolicy
-
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 interfaceMultitenantPolicy
- 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:
-
-