public class SingleTableMultitenantPolicy extends java.lang.Object implements MultitenantPolicy
Modifier and Type | Field and 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 and Description |
---|
SingleTableMultitenantPolicy(ClassDescriptor desc) |
Modifier and Type | Method and 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 |
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:
|
protected boolean includeTenantCriteria
protected ClassDescriptor descriptor
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
public SingleTableMultitenantPolicy(ClassDescriptor desc)
public void addFieldsToRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
addFieldsToRow
in interface MultitenantPolicy
public void addToTableDefinition(TableDefinition tableDefinition)
addToTableDefinition
in interface MultitenantPolicy
public MultitenantPolicy clone(ClassDescriptor descriptor)
clone
in interface MultitenantPolicy
public ClassDescriptor getDescriptor()
public void addTenantDiscriminatorField(java.lang.String property, org.eclipse.persistence.internal.helper.DatabaseField field)
public java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,java.lang.String> getTenantDiscriminatorFields()
public java.util.Map<java.lang.String,java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>> getTenantDiscriminatorFieldsKeyedOnContext()
public boolean hasTenantDiscriminatorFields()
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
initialize
in interface MultitenantPolicy
DescriptorException
public boolean isSingleTableMultitenantPolicy()
isSingleTableMultitenantPolicy
in interface MultitenantPolicy
public boolean isTablePerMultitenantPolicy()
isTablePerMultitenantPolicy
in interface MultitenantPolicy
public void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
postInitialize
in interface MultitenantPolicy
public void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
preInitialize
in interface MultitenantPolicy
DescriptorException
public void setDescriptor(ClassDescriptor descriptor)
public void setIncludeTenantCriteria(boolean includeTenantCriteria)
Multitenant
public void setTenantDiscriminatorFields(java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,java.lang.String> tenantDiscriminatorFields)