Search in sources :

Example 1 with AggregateMapping

use of org.eclipse.persistence.mappings.AggregateMapping in project eclipselink by eclipse-ee4j.

the class EmbeddedAccessor method process.

/**
 * INTERNAL:
 * Process an embedded.
 */
@Override
public void process() {
    // Build and aggregate object mapping and add it to the descriptor.
    AggregateMapping mapping = getOwningDescriptor().getClassDescriptor().newAggregateMapping();
    setMapping(mapping);
    mapping.setReferenceClassName(getReferenceClassName());
    mapping.setAttributeName(getAttributeName());
    // Will check for PROPERTY access
    setAccessorMethods(mapping);
    // EIS and ORDT mappings may not be aggregate object mappings.
    if (mapping.isAggregateObjectMapping()) {
        AggregateObjectMapping aggregateMapping = (AggregateObjectMapping) mapping;
        aggregateMapping.setIsNullAllowed(true);
        // Process attribute overrides.
        processAttributeOverrides(m_attributeOverrides, aggregateMapping, getReferenceDescriptor());
        // Process association overrides.
        processAssociationOverrides(m_associationOverrides, aggregateMapping, getReferenceDescriptor());
        // Process converts.
        processConverts(getConverts(m_converts), aggregateMapping, getReferenceClass(), false);
    } else if (mapping.isAbstractCompositeObjectMapping()) {
        ((AbstractCompositeObjectMapping) mapping).setField(getDatabaseField(getDescriptor().getPrimaryTable(), MetadataLogger.COLUMN));
    }
    // Process a @ReturnInsert and @ReturnUpdate (to log a warning message)
    processReturnInsertAndUpdate();
}
Also used : AggregateObjectMapping(org.eclipse.persistence.mappings.AggregateObjectMapping) AggregateMapping(org.eclipse.persistence.mappings.AggregateMapping)

Example 2 with AggregateMapping

use of org.eclipse.persistence.mappings.AggregateMapping in project eclipselink by eclipse-ee4j.

the class DirectCollectionAccessor method process.

/**
 * INTERNAL:
 */
protected void process(DatabaseMapping mapping) {
    // Add the mapping to the descriptor.
    setMapping(mapping);
    // Set the attribute name.
    mapping.setAttributeName(getAttributeName());
    // Will check for PROPERTY access
    setAccessorMethods(mapping);
    if (mapping instanceof CollectionMapping) {
        CollectionMapping collectionMapping = (CollectionMapping) mapping;
        // Set the reference class name.
        collectionMapping.setReferenceClassName(getReferenceClassName());
        // Process join fetch type.
        processJoinFetch(getJoinFetch(), collectionMapping);
        // Process the batch fetch if specified.
        processBatchFetch(collectionMapping);
        // Process the collection table.
        processCollectionTable(collectionMapping);
        // The spec. requires pessimistic lock to be extend-able to CollectionTable
        collectionMapping.setShouldExtendPessimisticLockScope(true);
        // Set the cascade on delete if specified.
        collectionMapping.setIsCascadeOnDeleteSetOnDatabase(isCascadeOnDelete());
    } else if (mapping instanceof AggregateMapping) {
        AggregateMapping aggregateMapping = (AggregateMapping) mapping;
        // Set the reference class name.
        aggregateMapping.setReferenceClassName(getReferenceClassName());
    }
    // Set the non cacheable if specified.
    mapping.setIsCacheable(!isNonCacheable());
    // Process a @ReturnInsert and @ReturnUpdate (to log a warning message)
    processReturnInsertAndUpdate();
    // Process any partitioning policies.
    processPartitioning();
}
Also used : DirectCollectionMapping(org.eclipse.persistence.mappings.DirectCollectionMapping) CollectionMapping(org.eclipse.persistence.mappings.CollectionMapping) AbstractCompositeDirectCollectionMapping(org.eclipse.persistence.mappings.foundation.AbstractCompositeDirectCollectionMapping) AggregateCollectionMapping(org.eclipse.persistence.mappings.AggregateCollectionMapping) AggregateMapping(org.eclipse.persistence.mappings.AggregateMapping)

Aggregations

AggregateMapping (org.eclipse.persistence.mappings.AggregateMapping)2 AggregateCollectionMapping (org.eclipse.persistence.mappings.AggregateCollectionMapping)1 AggregateObjectMapping (org.eclipse.persistence.mappings.AggregateObjectMapping)1 CollectionMapping (org.eclipse.persistence.mappings.CollectionMapping)1 DirectCollectionMapping (org.eclipse.persistence.mappings.DirectCollectionMapping)1 AbstractCompositeDirectCollectionMapping (org.eclipse.persistence.mappings.foundation.AbstractCompositeDirectCollectionMapping)1