public class TablePerMultitenantPolicy extends java.lang.Object implements MultitenantPolicy, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
contextProperty |
protected java.lang.String |
contextTenant |
protected ClassDescriptor |
descriptor |
protected java.util.Map<org.eclipse.persistence.internal.helper.DatabaseTable,org.eclipse.persistence.internal.helper.DatabaseTable> |
tablePerTenantTables |
protected TenantTableDiscriminatorType |
type |
Constructor and Description |
---|
TablePerMultitenantPolicy(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:
|
void |
addToTableDefinition(TableDefinition tableDefinition)
INTERNAL:
|
MultitenantPolicy |
clone(ClassDescriptor descriptor)
INTERNAL:
Multitenant policies are cloned per inheritance subclass.
|
java.lang.String |
getContextProperty()
INTERNAL:
Return the context property for this table per tenant policy.
|
org.eclipse.persistence.internal.helper.DatabaseTable |
getTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL:
Return the new database table associated with this tenant.
|
org.eclipse.persistence.internal.helper.DatabaseTable |
getTable(java.lang.String tableName)
INTERNAL:
Return the new database table associated with this tenant.
|
protected java.lang.String |
getTableName(org.eclipse.persistence.internal.helper.DatabaseTable table,
java.lang.String tenant)
INTERNAL:
Return the tenant table name.
|
boolean |
hasContextTenant()
INTERNAL:
Return true if the tenant has been set for this policy.
|
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
|
boolean |
isPrefixPerTable()
PUBLIC:
Return true if this descriptor requires a prefix to the table per tenant.
|
boolean |
isSchemaPerTable()
PUBLIC:
Return true if this descriptor requires a table schema per tenant.
|
boolean |
isSingleTableMultitenantPolicy()
INTERNAL:
|
boolean |
isSuffixPerTable()
PUBLIC:
Return true if this descriptor requires a suffix to the table per tenant.
|
boolean |
isTablePerMultitenantPolicy()
INTERNAL:
|
void |
postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
|
void |
preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
|
void |
setContextProperty(java.lang.String contextProperty)
PUBLIC:
Set the context property used to define the table per tenant.
|
void |
setContextTenant(java.lang.String contextTenant)
INTERNAL:
|
protected void |
setTablePerTenant()
INTERNAL:
This method is used to update the table per tenant descriptor with
a table per tenant prefix or suffix on its associated tables.
|
protected void |
setTableSchemaPerTenant()
INTERNAL:
This method is used to update the table per tenant descriptor with
a table per tenant schema.
|
void |
setTenantTableDiscriminatorType(TenantTableDiscriminatorType type)
PUBLIC:
Set the tenant table discriminator type.
|
boolean |
shouldInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
This method is called during regular descriptor initialization.
|
protected org.eclipse.persistence.internal.helper.DatabaseTable |
updateTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL:
This method will update the table by cloning it and setting a new name
on it.
|
boolean |
usesContextProperty(java.lang.String property)
INTERNAL:
Return true if this policy accepts the given property.
|
protected ClassDescriptor descriptor
protected java.util.Map<org.eclipse.persistence.internal.helper.DatabaseTable,org.eclipse.persistence.internal.helper.DatabaseTable> tablePerTenantTables
protected TenantTableDiscriminatorType type
protected java.lang.String contextProperty
protected java.lang.String contextTenant
public TablePerMultitenantPolicy(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 java.lang.String getContextProperty()
public org.eclipse.persistence.internal.helper.DatabaseTable getTable(java.lang.String tableName)
public org.eclipse.persistence.internal.helper.DatabaseTable getTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
protected java.lang.String getTableName(org.eclipse.persistence.internal.helper.DatabaseTable table, java.lang.String tenant)
public boolean hasContextTenant()
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
initialize
in interface MultitenantPolicy
DescriptorException
public boolean isPrefixPerTable()
public boolean isSchemaPerTable()
public boolean isSingleTableMultitenantPolicy()
isSingleTableMultitenantPolicy
in interface MultitenantPolicy
public boolean isSuffixPerTable()
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 setTenantTableDiscriminatorType(TenantTableDiscriminatorType type)
public void setContextProperty(java.lang.String contextProperty)
protected void setTablePerTenant()
protected void setTableSchemaPerTenant()
public void setContextTenant(java.lang.String contextTenant)
public boolean shouldInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
protected org.eclipse.persistence.internal.helper.DatabaseTable updateTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
public boolean usesContextProperty(java.lang.String property)