Top Description Fields Constructors Methods
org.eclipse.persistence.descriptors.partitioning

public abstract Class FieldPartitioningPolicy

extends PartitioningPolicy
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.descriptors.partitioning.HashPartitioningPolicy, org.eclipse.persistence.descriptors.partitioning.RangePartitioningPolicy, org.eclipse.persistence.descriptors.partitioning.ValuePartitioningPolicy
Imports
org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.internal.helper.DatabaseField, org.eclipse.persistence.internal.sessions.AbstractSession, org.eclipse.persistence.sessions.server.ClientSession

PUBLIC: FieldPartitioningPolicy partitions access to a database cluster by a field value from the object, such as the object's id, location, or tenant. All write or read request for object's with that value are sent to the server. If a query does not include the field as a parameter, then it can either be sent to all server's and unioned, or left to the sesion's default behavior.
Author
James Sutherland
Since
EclipseLink 2.2

Field Summary

Modifier and TypeField and Description
protected DatabaseField
partitionField

The column to partition by.

protected boolean
unionUnpartitionableQueries

If query does not have the partition field in it, should the query be sent to all databases.

Inherited from org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy:
name

Constructor Summary

AccessConstructor and Description
protected
protected
protected
FieldPartitioningPolicy(String partitionField, boolean unionUnpartitionableQueries)

Method Summary

Modifier and TypeMethod and Description
protected Object
extractPartitionValueForPersist(AbstractSession session, Object object, ClassDescriptor descriptor)

INTERNAL: If persist should be partitioned, extra value from object.

public DatabaseField
getPartitionField()

PUBLIC: Return the database column or query parameter to partition queries by.

public String
getPartitionFieldName()

PUBLIC: Return the database column or query parameter to partition queries by.

public boolean
getUnionUnpartitionableQueries()

PUBLIC: Return if queries that do not contain the partition field should be sent to every database and have the result unioned.

public void
setPartitionField(DatabaseField partitionField)

PUBLIC: Set the database column or query parameter to partition queries by.

public void
setPartitionField(String partitionField)

PUBLIC: Set the database column or query parameter to partition queries by.

public void
setUnionUnpartitionableQueries(boolean unionUnpartitionableQueries)

PUBLIC: Set if queries that do not contain the partition field should be sent to every database and have the result unioned.

Inherited from org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy:
acquireAccessorconvertClassNamesToClassesgetAccessorgetConnectionsForQuerygetNameinitializepartitionPersistsetName

Field Detail

partitionFieldback to summary
protected DatabaseField partitionField

The column to partition by.

unionUnpartitionableQueriesback to summary
protected boolean unionUnpartitionableQueries

If query does not have the partition field in it, should the query be sent to all databases.

Constructor Detail

FieldPartitioningPolicyback to summary
protected FieldPartitioningPolicy()
FieldPartitioningPolicyback to summary
protected FieldPartitioningPolicy(String partitionField)
FieldPartitioningPolicyback to summary
protected FieldPartitioningPolicy(String partitionField, boolean unionUnpartitionableQueries)

Method Detail

extractPartitionValueForPersistback to summary
protected Object extractPartitionValueForPersist(AbstractSession session, Object object, ClassDescriptor descriptor)

INTERNAL: If persist should be partitioned, extra value from object.

getPartitionFieldback to summary
public DatabaseField getPartitionField()

PUBLIC: Return the database column or query parameter to partition queries by. This is the table column name, not the class attribute name. The column value must be included in the query and should normally be part of the object's Id. This can also be the name of a query parameter. If a query does not contain the field the query will not be partitioned.

getPartitionFieldNameback to summary
public String getPartitionFieldName()

PUBLIC: Return the database column or query parameter to partition queries by. This is the table column name, not the class attribute name. The column value must be included in the query and should normally be part of the object's Id. This can also be the name of a query parameter. If a query does not contain the field the query will not be partitioned.

getUnionUnpartitionableQueriesback to summary
public boolean getUnionUnpartitionableQueries()

PUBLIC: Return if queries that do not contain the partition field should be sent to every database and have the result unioned.

setPartitionFieldback to summary
public void setPartitionField(DatabaseField partitionField)

PUBLIC: Set the database column or query parameter to partition queries by. This is the table column name, not the class attribute name. The column value must be included in the query and should normally be part of the object's Id. This can also be the name of a query parameter. If a query does not contain the field the query will not be partitioned.

setPartitionFieldback to summary
public void setPartitionField(String partitionField)

PUBLIC: Set the database column or query parameter to partition queries by. This is the table column name, not the class attribute name. The column value must be included in the query and should normally be part of the object's Id. This can also be the name of a query parameter. If a query does not contain the field the query will not be partitioned.

setUnionUnpartitionableQueriesback to summary
public void setUnionUnpartitionableQueries(boolean unionUnpartitionableQueries)

PUBLIC: Set if queries that do not contain the partition field should be sent to every database and have the result unioned.