Search in sources :

Example 1 with HashPartitioningMetadata

use of org.eclipse.persistence.internal.jpa.metadata.partitioning.HashPartitioningMetadata 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)

Example 2 with HashPartitioningMetadata

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

the class XMLEntityMappings method process.

/**
 * INTERNAL:
 * Process the metadata from the <entity-mappings> level except for the
 * classes themselves. They will be processed afterwards and controlled
 * by the MetadataProcessor. Note: this method does a few things of
 * interest. It not only adds metadata to the project but it will also
 * override (that is EclipseLink-ORM-XML-->JPA-XML {@literal &&} JPA-XML-->Annotation)
 * the necessary metadata and log messages to the user. A validation
 * exception could also be thrown. See the related processing methods for
 * more details.
 *
 * Any XML metadata of the types processed below should call these methods.
 * That is, as an example, a converter can be found at the entity-mappings
 * and entity level. Therefore you must ensure that those from levels other
 * than the entity-mappings call these methods as well to ensure consistent
 * metadata processing (and behavior).
 */
public void process() {
    // Add the XML converters to the project.
    for (ConverterMetadata converter : m_converters) {
        converter.initXMLObject(m_file, this);
        m_project.addConverter(converter);
    }
    // Add the XML type converters to the project.
    for (TypeConverterMetadata typeConverter : m_typeConverters) {
        typeConverter.initXMLObject(m_file, this);
        m_project.addConverter(typeConverter);
    }
    // Add the XML object type converters to the project.
    for (ObjectTypeConverterMetadata objectTypeConverter : m_objectTypeConverters) {
        objectTypeConverter.initXMLObject(m_file, this);
        m_project.addConverter(objectTypeConverter);
    }
    // Add the XML serialized converters to the project.
    for (SerializedConverterMetadata serializedConverter : m_serializedConverters) {
        serializedConverter.initXMLObject(m_file, this);
        m_project.addConverter(serializedConverter);
    }
    // Add the XML struct converters to the project.
    for (StructConverterMetadata structConverter : m_structConverters) {
        structConverter.initXMLObject(m_file, this);
        m_project.addConverter(structConverter);
    }
    // Add the XML table generators to the project.
    for (TableGeneratorMetadata tableGenerator : m_tableGenerators) {
        tableGenerator.initXMLObject(m_file, this);
        m_project.addTableGenerator(tableGenerator, getDefaultCatalog(), getDefaultSchema());
    }
    // Add the XML sequence generators to the project.
    for (SequenceGeneratorMetadata sequenceGenerator : m_sequenceGenerators) {
        sequenceGenerator.initXMLObject(m_file, this);
        m_project.addSequenceGenerator(sequenceGenerator, getDefaultCatalog(), getDefaultSchema());
    }
    // Add the XML uuid generators to the project.
    for (UuidGeneratorMetadata uuidGenerator : m_uuidGenerators) {
        uuidGenerator.initXMLObject(m_file, this);
        m_project.addUuidGenerator(uuidGenerator);
    }
    // Add the partitioning to the project.
    for (PartitioningMetadata partitioning : m_partitioning) {
        partitioning.initXMLObject(m_file, this);
        m_project.addPartitioningPolicy(partitioning);
    }
    // Add the replication partitioning to the project.
    for (ReplicationPartitioningMetadata partitioning : m_replicationPartitioning) {
        partitioning.initXMLObject(m_file, this);
        m_project.addPartitioningPolicy(partitioning);
    }
    // Add the round robin partitioning to the project.
    for (RoundRobinPartitioningMetadata partitioning : m_roundRobinPartitioning) {
        partitioning.initXMLObject(m_file, this);
        m_project.addPartitioningPolicy(partitioning);
    }
    // Add the pinned partitioning to the project.
    for (PinnedPartitioningMetadata partitioning : m_pinnedPartitioning) {
        partitioning.initXMLObject(m_file, this);
        m_project.addPartitioningPolicy(partitioning);
    }
    // Add the range partitioning to the project.
    for (RangePartitioningMetadata partitioning : m_rangePartitioning) {
        partitioning.initXMLObject(m_file, this);
        m_project.addPartitioningPolicy(partitioning);
    }
    // Add the value partitioning to the project.
    for (ValuePartitioningMetadata partitioning : m_valuePartitioning) {
        partitioning.initXMLObject(m_file, this);
        m_project.addPartitioningPolicy(partitioning);
    }
    // Add the hash partitioning to the project.
    for (HashPartitioningMetadata partitioning : m_hashPartitioning) {
        partitioning.initXMLObject(m_file, this);
        m_project.addPartitioningPolicy(partitioning);
    }
    // Add the XML named queries to the project.
    for (NamedQueryMetadata namedQuery : m_namedQueries) {
        namedQuery.initXMLObject(m_file, this);
        m_project.addQuery(namedQuery);
    }
    // Add the XML named native queries to the project.
    for (NamedNativeQueryMetadata namedNativeQuery : m_namedNativeQueries) {
        namedNativeQuery.initXMLObject(m_file, this);
        m_project.addQuery(namedNativeQuery);
    }
    // Add the XML named stored procedure queries to the project.
    for (NamedStoredProcedureQueryMetadata namedStoredProcedureQuery : m_namedStoredProcedureQueries) {
        namedStoredProcedureQuery.initXMLObject(m_file, this);
        m_project.addQuery(namedStoredProcedureQuery);
    }
    // Add the XML named stored function queries to the project.
    for (NamedStoredFunctionQueryMetadata namedStoredFunctionQuery : m_namedStoredFunctionQueries) {
        namedStoredFunctionQuery.initXMLObject(m_file, this);
        m_project.addQuery(namedStoredFunctionQuery);
    }
    // Add the XML named stored procedure queries to the project.
    for (NamedPLSQLStoredProcedureQueryMetadata namedPLSQLStoredProcedureQuery : m_namedPLSQLStoredProcedureQueries) {
        namedPLSQLStoredProcedureQuery.initXMLObject(m_file, this);
        m_project.addQuery(namedPLSQLStoredProcedureQuery);
    }
    // Add the XML named stored function queries to the project.
    for (NamedPLSQLStoredFunctionQueryMetadata namedPLSQLStoredFunctionQuery : m_namedPLSQLStoredFunctionQueries) {
        namedPLSQLStoredFunctionQuery.initXMLObject(m_file, this);
        m_project.addQuery(namedPLSQLStoredFunctionQuery);
    }
    // Add the XML sql result set mappings to the project.
    for (SQLResultSetMappingMetadata sqlResultSetMapping : m_sqlResultSetMappings) {
        sqlResultSetMapping.initXMLObject(m_file, this);
        m_project.addSQLResultSetMapping(sqlResultSetMapping);
    }
    // Add the Oracle object types to the project.
    for (OracleObjectTypeMetadata oType : m_oracleObjectTypes) {
        oType.initXMLObject(m_file, this);
        m_project.addComplexMetadataType(oType);
    }
    // Add the Oracle array types to the project.
    for (OracleArrayTypeMetadata aType : m_oracleArrayTypes) {
        aType.initXMLObject(m_file, this);
        m_project.addComplexMetadataType(aType);
    }
    // Add the PLSQL types to the project.
    for (PLSQLRecordMetadata record : m_plsqlRecords) {
        record.initXMLObject(m_file, this);
        m_project.addComplexMetadataType(record);
    }
    // Add the PLSQL tables to the project.
    for (PLSQLTableMetadata table : m_plsqlTables) {
        table.initXMLObject(m_file, this);
        m_project.addComplexMetadataType(table);
    }
}
Also used : NamedStoredFunctionQueryMetadata(org.eclipse.persistence.internal.jpa.metadata.queries.NamedStoredFunctionQueryMetadata) RoundRobinPartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.RoundRobinPartitioningMetadata) PLSQLRecordMetadata(org.eclipse.persistence.internal.jpa.metadata.queries.PLSQLRecordMetadata) PinnedPartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.PinnedPartitioningMetadata) TypeConverterMetadata(org.eclipse.persistence.internal.jpa.metadata.converters.TypeConverterMetadata) ObjectTypeConverterMetadata(org.eclipse.persistence.internal.jpa.metadata.converters.ObjectTypeConverterMetadata) ReplicationPartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.ReplicationPartitioningMetadata) TableGeneratorMetadata(org.eclipse.persistence.internal.jpa.metadata.sequencing.TableGeneratorMetadata) HashPartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.HashPartitioningMetadata) OracleArrayTypeMetadata(org.eclipse.persistence.internal.jpa.metadata.queries.OracleArrayTypeMetadata) StructConverterMetadata(org.eclipse.persistence.internal.jpa.metadata.converters.StructConverterMetadata) RangePartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.RangePartitioningMetadata) NamedStoredProcedureQueryMetadata(org.eclipse.persistence.internal.jpa.metadata.queries.NamedStoredProcedureQueryMetadata) NamedQueryMetadata(org.eclipse.persistence.internal.jpa.metadata.queries.NamedQueryMetadata) StructConverterMetadata(org.eclipse.persistence.internal.jpa.metadata.converters.StructConverterMetadata) SerializedConverterMetadata(org.eclipse.persistence.internal.jpa.metadata.converters.SerializedConverterMetadata) TypeConverterMetadata(org.eclipse.persistence.internal.jpa.metadata.converters.TypeConverterMetadata) ConverterMetadata(org.eclipse.persistence.internal.jpa.metadata.converters.ConverterMetadata) MixedConverterMetadata(org.eclipse.persistence.internal.jpa.metadata.converters.MixedConverterMetadata) ObjectTypeConverterMetadata(org.eclipse.persistence.internal.jpa.metadata.converters.ObjectTypeConverterMetadata) SequenceGeneratorMetadata(org.eclipse.persistence.internal.jpa.metadata.sequencing.SequenceGeneratorMetadata) OracleObjectTypeMetadata(org.eclipse.persistence.internal.jpa.metadata.queries.OracleObjectTypeMetadata) UuidGeneratorMetadata(org.eclipse.persistence.internal.jpa.metadata.sequencing.UuidGeneratorMetadata) SQLResultSetMappingMetadata(org.eclipse.persistence.internal.jpa.metadata.queries.SQLResultSetMappingMetadata) ObjectTypeConverterMetadata(org.eclipse.persistence.internal.jpa.metadata.converters.ObjectTypeConverterMetadata) ValuePartitioningMetadata(org.eclipse.persistence.internal.jpa.metadata.partitioning.ValuePartitioningMetadata) SerializedConverterMetadata(org.eclipse.persistence.internal.jpa.metadata.converters.SerializedConverterMetadata) PLSQLTableMetadata(org.eclipse.persistence.internal.jpa.metadata.queries.PLSQLTableMetadata) NamedPLSQLStoredProcedureQueryMetadata(org.eclipse.persistence.internal.jpa.metadata.queries.NamedPLSQLStoredProcedureQueryMetadata) NamedNativeQueryMetadata(org.eclipse.persistence.internal.jpa.metadata.queries.NamedNativeQueryMetadata) 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) NamedPLSQLStoredFunctionQueryMetadata(org.eclipse.persistence.internal.jpa.metadata.queries.NamedPLSQLStoredFunctionQueryMetadata)

Aggregations

HashPartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.HashPartitioningMetadata)2 PartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.PartitioningMetadata)2 PinnedPartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.PinnedPartitioningMetadata)2 RangePartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.RangePartitioningMetadata)2 ReplicationPartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.ReplicationPartitioningMetadata)2 RoundRobinPartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.RoundRobinPartitioningMetadata)2 UnionPartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.UnionPartitioningMetadata)2 ValuePartitioningMetadata (org.eclipse.persistence.internal.jpa.metadata.partitioning.ValuePartitioningMetadata)2 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 ConverterMetadata (org.eclipse.persistence.internal.jpa.metadata.converters.ConverterMetadata)1 MixedConverterMetadata (org.eclipse.persistence.internal.jpa.metadata.converters.MixedConverterMetadata)1 ObjectTypeConverterMetadata (org.eclipse.persistence.internal.jpa.metadata.converters.ObjectTypeConverterMetadata)1