Class UnionPartitioningPolicy
java.lang.Object
org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy
org.eclipse.persistence.descriptors.partitioning.ReplicationPartitioningPolicy
org.eclipse.persistence.descriptors.partitioning.UnionPartitioningPolicy
- All Implemented Interfaces:
Serializable
PUBLIC:
UnionPartitionPolicy sends queries to all connection pools and unions the results.
This is for queries or relationships that span partitions when partitioning is used,
such as on a ManyToMany cross partition relationship.
- See Also:
- Author:
- James Sutherland
-
Field Summary
Fields inherited from class org.eclipse.persistence.descriptors.partitioning.ReplicationPartitioningPolicy
connectionPools
Fields inherited from class org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy
name
-
Constructor Summary
ConstructorDescriptionUnionPartitioningPolicy
(boolean replicateWrites) UnionPartitioningPolicy
(String... pools) UnionPartitioningPolicy
(List<String> pools) -
Method Summary
Modifier and TypeMethodDescriptionList<org.eclipse.persistence.internal.databaseaccess.Accessor>
getConnectionsForQuery
(org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord arguments) INTERNAL: Get a connection from one of the pools in a round robin rotation fashion.boolean
PUBLIC: Return if write queries should be replicated.void
setReplicateWrites
(boolean replicateWrites) PUBLIC: Set if write queries should be replicated.Methods inherited from class org.eclipse.persistence.descriptors.partitioning.ReplicationPartitioningPolicy
addConnectionPool, getConnectionPools, initialize, setConnectionPools
Methods inherited from class org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy
acquireAccessor, convertClassNamesToClasses, getAccessor, getName, partitionPersist, setName
-
Field Details
-
replicateWrites
protected boolean replicateWrites
-
-
Constructor Details
-
UnionPartitioningPolicy
public UnionPartitioningPolicy() -
UnionPartitioningPolicy
public UnionPartitioningPolicy(boolean replicateWrites) -
UnionPartitioningPolicy
-
UnionPartitioningPolicy
-
-
Method Details
-
getReplicateWrites
public boolean getReplicateWrites()PUBLIC: Return if write queries should be replicated. Writes are normally not replicated when unioning, but can be for ManyToMany relationships, when the join table needs to be replicated. -
setReplicateWrites
public void setReplicateWrites(boolean replicateWrites) PUBLIC: Set if write queries should be replicated. Writes are normally not replicated when unioning, but can be for ManyToMany relationships, when the join table needs to be replicated. -
getConnectionsForQuery
public List<org.eclipse.persistence.internal.databaseaccess.Accessor> getConnectionsForQuery(org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord arguments) INTERNAL: Get a connection from one of the pools in a round robin rotation fashion.- Overrides:
getConnectionsForQuery
in classReplicationPartitioningPolicy
-