Search in sources :

Example 1 with UnionPartitioningMetadata

use of org.eclipse.persistence.internal.jpa.metadata.partitioning.UnionPartitioningMetadata in project eclipselink by eclipse-ee4j.

the class MetadataAccessor method processPartitioning.

/**
 * Process the partitioning policies defined on this element.
 */
protected void processPartitioning() {
    boolean found = false;
    // Check for XML defined partitioning.
    if (m_replicationPartitioning != null) {
        found = true;
        getProject().addPartitioningPolicy(m_replicationPartitioning);
    }
    if (m_roundRobinPartitioning != null) {
        found = true;
        getProject().addPartitioningPolicy(m_roundRobinPartitioning);
    }
    if (m_partitioning != null) {
        found = true;
        getProject().addPartitioningPolicy(m_partitioning);
    }
    if (m_rangePartitioning != null) {
        found = true;
        getProject().addPartitioningPolicy(m_rangePartitioning);
    }
    if (m_valuePartitioning != null) {
        found = true;
        getProject().addPartitioningPolicy(m_valuePartitioning);
    }
    if (m_hashPartitioning != null) {
        found = true;
        getProject().addPartitioningPolicy(m_hashPartitioning);
    }
    if (m_unionPartitioning != null) {
        found = true;
        getProject().addPartitioningPolicy(m_unionPartitioning);
    }
    if (m_pinnedPartitioning != null) {
        found = true;
        getProject().addPartitioningPolicy(m_pinnedPartitioning);
    }
    // Check for partitioning annotations.
    MetadataAnnotation annotation = getAnnotation(Partitioning.class);
    if (annotation != null) {
        found = true;
        getProject().addPartitioningPolicy(new PartitioningMetadata(annotation, this));
    }
    annotation = getAnnotation(ReplicationPartitioning.class);
    if (annotation != null) {
        found = true;
        getProject().addPartitioningPolicy(new ReplicationPartitioningMetadata(annotation, this));
    }
    annotation = getAnnotation(RoundRobinPartitioning.class);
    if (annotation != null) {
        found = true;
        getProject().addPartitioningPolicy(new RoundRobinPartitioningMetadata(annotation, this));
    }
    annotation = getAnnotation(UnionPartitioning.class);
    if (annotation != null) {
        found = true;
        getProject().addPartitioningPolicy(new UnionPartitioningMetadata(annotation, this));
    }
    annotation = getAnnotation(RangePartitioning.class);
    if (annotation != null) {
        found = true;
        getProject().addPartitioningPolicy(new RangePartitioningMetadata(annotation, this));
    }
    annotation = getAnnotation(ValuePartitioning.class);
    if (annotation != null) {
        found = true;
        getProject().addPartitioningPolicy(new ValuePartitioningMetadata(annotation, this));
    }
    annotation = getAnnotation(ValuePartitioning.class);
    if (annotation != null) {
        found = true;
        getProject().addPartitioningPolicy(new ValuePartitioningMetadata(annotation, this));
    }
    annotation = getAnnotation(PinnedPartitioning.class);
    if (annotation != null) {
        found = true;
        getProject().addPartitioningPolicy(new PinnedPartitioningMetadata(annotation, this));
    }
    annotation = getAnnotation(HashPartitioning.class);
    if (annotation != null) {
        found = true;
        getProject().addPartitioningPolicy(new HashPartitioningMetadata(annotation, this));
    }
    boolean processed = false;
    if (m_partitioned != null) {
        processed = true;
        processPartitioned(m_partitioned);
    }
    annotation = getAnnotation(Partitioned.class);
    if (!processed && annotation != null) {
        processed = true;
        processPartitioned(annotation.getAttributeString("value"));
    }
    if (found && !processed) {
        getLogger().logWarningMessage(MetadataLogger.WARNING_PARTIONED_NOT_SET, getJavaClass(), getAccessibleObject());
    }
}
Also used : Partitioned(org.eclipse.persistence.annotations.Partitioned) PinnedPartitioning(org.eclipse.persistence.annotations.PinnedPartitioning) RangePartitioning(org.eclipse.persistence.annotations.RangePartitioning) RangePartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.RangePartitioningMetadata) RoundRobinPartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.RoundRobinPartitioningMetadata) UnionPartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.UnionPartitioningMetadata) ValuePartitioning(org.eclipse.persistence.annotations.ValuePartitioning) MetadataAnnotation(org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotation) PinnedPartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.PinnedPartitioningMetadata) UnionPartitioning(org.eclipse.persistence.annotations.UnionPartitioning) ReplicationPartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.ReplicationPartitioningMetadata) HashPartitioning(org.eclipse.persistence.annotations.HashPartitioning) ValuePartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.ValuePartitioningMetadata) ReplicationPartitioning(org.eclipse.persistence.annotations.ReplicationPartitioning) HashPartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.HashPartitioningMetadata) PartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.PartitioningMetadata) UnionPartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.UnionPartitioningMetadata) ReplicationPartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.ReplicationPartitioningMetadata) RoundRobinPartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.RoundRobinPartitioningMetadata) HashPartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.HashPartitioningMetadata) RangePartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.RangePartitioningMetadata) ValuePartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.ValuePartitioningMetadata) PinnedPartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.PinnedPartitioningMetadata) RoundRobinPartitioning(org.eclipse.persistence.annotations.RoundRobinPartitioning)

Aggregations

HashPartitioning (org.eclipse.persistence.annotations.HashPartitioning)1 Partitioned (org.eclipse.persistence.annotations.Partitioned)1 PinnedPartitioning (org.eclipse.persistence.annotations.PinnedPartitioning)1 RangePartitioning (org.eclipse.persistence.annotations.RangePartitioning)1 ReplicationPartitioning (org.eclipse.persistence.annotations.ReplicationPartitioning)1 RoundRobinPartitioning (org.eclipse.persistence.annotations.RoundRobinPartitioning)1 UnionPartitioning (org.eclipse.persistence.annotations.UnionPartitioning)1 ValuePartitioning (org.eclipse.persistence.annotations.ValuePartitioning)1 MetadataAnnotation (org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotation)1 HashPartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.HashPartitioningMetadata)1 PartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.PartitioningMetadata)1 PinnedPartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.PinnedPartitioningMetadata)1 RangePartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.RangePartitioningMetadata)1 ReplicationPartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.ReplicationPartitioningMetadata)1 RoundRobinPartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.RoundRobinPartitioningMetadata)1 UnionPartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.UnionPartitioningMetadata)1 ValuePartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.ValuePartitioningMetadata)1