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

public Class RangePartitioningPolicy

extends FieldPartitioningPolicy
Class Inheritance
Imports
java.util.ArrayList, .List, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.internal.databaseaccess.Accessor, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, org.eclipse.persistence.queries.DatabaseQuery

PUBLIC: RangePartitioningPolicy partitions access to a database cluster by a field value from the object, such as the object's id, location, or tenant. Each server is assigned a range of values. 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 List<RangePartition>
Inherited from org.eclipse.persistence.descriptors.partitioning.FieldPartitioningPolicy:
partitionFieldunionUnpartitionableQueries

Constructor Summary

AccessConstructor and Description
public
public
public
RangePartitioningPolicy(String partitionField, boolean unionUnpartitionableQueries)

public
RangePartitioningPolicy(String partitionField, RangePartition... partitions)

Method Summary

Modifier and TypeMethod and Description
public void
addPartition(String connectionPool, Comparable<T> startValue, Comparable<T> endValue)

PUBLIC: Add the range partition.

public void
addPartition(RangePartition partition)

PUBLIC: Add the range partition.

public void
convertClassNamesToClasses(ClassLoader classLoader)

Overrides org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy.convertClassNamesToClasses.

INTERNAL: Convert all the class-name-based settings to actual class-based settings.
public List<Accessor>
getConnectionsForQuery(AbstractSession session, DatabaseQuery query, AbstractRecord arguments)

Implements abstract org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy.getConnectionsForQuery.

INTERNAL: Get a connection from one of the pools in a round robin rotation fashion.
public List<RangePartition>
getPartitions()

PUBLIC: Return the range partitions.

public void
partitionPersist(AbstractSession session, Object object, ClassDescriptor descriptor)

Overrides org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy.partitionPersist.

INTERNAL: Allow for the persist call to assign the partition.
public void
setPartitions(List<RangePartition> partitions)

PUBLIC: Set the range partitions.

Inherited from org.eclipse.persistence.descriptors.partitioning.FieldPartitioningPolicy:
extractPartitionValueForPersistgetPartitionFieldgetPartitionFieldNamegetUnionUnpartitionableQueriessetPartitionFieldsetPartitionFieldsetUnionUnpartitionableQueries

Field Detail

partitionsback to summary
protected List<RangePartition> partitions

Constructor Detail

RangePartitioningPolicyback to summary
public RangePartitioningPolicy()
RangePartitioningPolicyback to summary
public RangePartitioningPolicy(String partitionField)
RangePartitioningPolicyback to summary
public RangePartitioningPolicy(String partitionField, boolean unionUnpartitionableQueries)
RangePartitioningPolicyback to summary
public RangePartitioningPolicy(String partitionField, RangePartition... partitions)

Method Detail

addPartitionback to summary
public void addPartition(String connectionPool, Comparable<T> startValue, Comparable<T> endValue)

PUBLIC: Add the range partition.

addPartitionback to summary
public void addPartition(RangePartition partition)

PUBLIC: Add the range partition.

convertClassNamesToClassesback to summary
public void convertClassNamesToClasses(ClassLoader classLoader)

Overrides org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy.convertClassNamesToClasses.

INTERNAL: Convert all the class-name-based settings to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.

Annotations
@Override
getConnectionsForQueryback to summary
public List<Accessor> getConnectionsForQuery(AbstractSession session, DatabaseQuery query, AbstractRecord arguments)

Implements abstract org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy.getConnectionsForQuery.

INTERNAL: Get a connection from one of the pools in a round robin rotation fashion.

Annotations
@Override
getPartitionsback to summary
public List<RangePartition> getPartitions()

PUBLIC: Return the range partitions. Each partition represents a range of value to route to a connection pool. Range values should not overlap.

partitionPersistback to summary
public void partitionPersist(AbstractSession session, Object object, ClassDescriptor descriptor)

Overrides org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy.partitionPersist.

INTERNAL: Allow for the persist call to assign the partition.

Annotations
@Override
setPartitionsback to summary
public void setPartitions(List<RangePartition> partitions)

PUBLIC: Set the range partitions. Each partition represents a range of value to route to a connection pool. Range values should not overlap.