Package org.eclipse.persistence.mappings

Examples of org.eclipse.persistence.mappings.DirectMapMapping


     */
    protected void processDirectMapMapping() {
        // Initialize and process common direct collection metadata. This must
        // be done before any field processing since field processing requires
        // that the collection table be processed before hand.
        DirectMapMapping mapping = new DirectMapMapping();
        process(mapping);
       
        // Process the container and indirection policies.
        processContainerPolicyAndIndirection(mapping);
       
        // Process the key column (we must process this field before the
        // call to processConverter, since it may set a field classification)
        mapping.setDirectKeyField(getDatabaseField(getReferenceDatabaseTable(), MetadataLogger.MAP_KEY_COLUMN));
       
        // Only process the key converter if this is a basic map accessor. The
        // key converter for an element collection case will be taken care of
        // in the processContainerPolicyAndIndirection call above.
        if (isBasicMap()) {
            // To resolve any generic types (or respect an attribute type
            // specification) we need to set the attribute classification on the
            // mapping to ensure we do the right conversions.
            if (hasAttributeType() || getAccessibleObject().isGenericCollectionType()) {
                mapping.setDirectKeyFieldClassification(getJavaClass(getMapKeyReferenceClass()));
            }
           
            // Process a converter for the key column of this mapping.
            processMappingKeyConverter(mapping, getKeyConverter(), getMapKeyReferenceClass());
        }
       
        // Process the value column (we must process this field before the call
        // to processConverter, since it may set a field classification)
        mapping.setDirectField(getDatabaseField(getReferenceDatabaseTable(), MetadataLogger.VALUE_COLUMN));
       
        // To resolve any generic types (or respect an attribute type
        // specification) we need to set the attribute classification on the
        // mapping to ensure we do the right conversions.
        if (hasAttributeType() || getAccessibleObject().isGenericCollectionType()) {
            mapping.setDirectFieldClassification(getJavaClass(getReferenceClass()));
        }
       
        // Process a converter for value column of this mapping.
        processMappingValueConverter(mapping, getValueConverter(), getReferenceClass());   
    }
View Full Code Here


     */
    protected void processDirectMapMapping() {
        // Initialize and process common direct collection metadata. This must
        // be done before any field processing since field processing requires
        // that the collection table be processed before hand.
        DirectMapMapping mapping = new DirectMapMapping();
        process(mapping);
       
        // Process the container and indirection policies.
        processContainerPolicyAndIndirection(mapping);
       
        // Process the key column (we must process this field before the
        // call to processConverter, since it may set a field classification)
        mapping.setDirectKeyField(getDatabaseField(getReferenceDatabaseTable(), MetadataLogger.MAP_KEY_COLUMN));
       
        // Only process the key converter if this is a basic map accessor. The
        // key converter for an element collection case will be taken care of
        // in the processContainerPolicyAndIndirection call above.
        if (isBasicMap()) {
            // Process a converter for the key column of this mapping.
            processMappingKeyConverter(mapping, getKeyConverter(), getMapKeyReferenceClass());
        }
       
        // Process the value column (we must process this field before the call
        // to processConverter, since it may set a field classification)
        mapping.setDirectField(getDatabaseField(getReferenceDatabaseTable(), MetadataLogger.VALUE_COLUMN));
       
        // Process a converter for value column of this mapping.
        processMappingValueConverter(mapping, getValueConverter(), getReferenceClass());   
    }
View Full Code Here

    Declaration declaration = queryContext.findDeclaration(identificationVariable.getVariableName());
    DatabaseMapping mapping = declaration.getMapping();

    if (mapping.isDirectMapMapping()) {

      DirectMapMapping mapMapping = (DirectMapMapping) mapping;
      type = mapMapping.getValueClass();

      if (type == null) {
        type = mapMapping.getDirectField().getType();
      }
    }
    else {
      type = calculateMappingType(declaration.getMapping());
    }
View Full Code Here

                m.setConverter(this);
                m.setFieldClassification(fieldClassification);
                m.setFieldClassificationClassName(fieldClassificationName);
            }
        } else if (mapping.isDirectMapMapping() && isForMapKey) {
            DirectMapMapping m = (DirectMapMapping) mapping;
           
            if (disableConversion) {
                m.setKeyConverter(null);
            } else {
                m.setKeyConverter(this);
                m.setDirectKeyFieldClassification(fieldClassification);
                m.setDirectKeyFieldClassificationName(fieldClassificationName);
            }
        }  else if (mapping.isDirectCollectionMapping()) {
            DirectCollectionMapping m = (DirectCollectionMapping) mapping;
           
            if (disableConversion) {
                m.setValueConverter(null);
            } else {
                m.setValueConverter(this);
                m.setDirectFieldClassification(fieldClassification);
                m.setDirectFieldClassificationName(fieldClassificationName);
            }
        } else {
            // TODO: what else could it be???
        }
    }
View Full Code Here

     */
    protected void processDirectMapMapping() {
        // Initialize and process common direct collection metadata. This must
        // be done before any field processing since field processing requires
        // that the collection table be processed before hand.
        DirectMapMapping mapping = new DirectMapMapping();
        process(mapping);
       
        // Process the container and indirection policies.
        processContainerPolicyAndIndirection(mapping);
       
        // Process the key column (we must process this field before the
        // call to processConverter, since it may set a field classification)
        mapping.setDirectKeyField(getDatabaseField(getReferenceDatabaseTable(), MetadataLogger.MAP_KEY_COLUMN));
       
        // Only process the key converter if this is a basic map accessor. The
        // key converter for an element collection case will be taken care of
        // in the processContainerPolicyAndIndirection call above.
        if (isBasicMap()) {
            // To resolve any generic types (or respect an attribute type
            // specification) we need to set the attribute classification on the
            // mapping to ensure we do the right conversions.
            if (hasAttributeType() || getAccessibleObject().isGenericCollectionType()) {
                mapping.setDirectKeyFieldClassificationName(getJavaClassName(getMapKeyReferenceClass()));
            }
           
            // Process a converter for the key column of this mapping.
            processMappingKeyConverter(mapping, getKeyConverter(), null, getMapKeyReferenceClass(), getMapKeyReferenceClassWithGenerics());
        }
       
        // Process the value column (we must process this field before the call
        // to processConverter, since it may set a field classification)
        mapping.setDirectField(getDatabaseField(getReferenceDatabaseTable(), MetadataLogger.VALUE_COLUMN));
       
        // To resolve any generic types (or respect an attribute type
        // specification) we need to set the attribute classification on the
        // mapping to ensure we do the right conversions.
        if (hasAttributeType() || getAccessibleObject().isGenericCollectionType()) {
            mapping.setDirectFieldClassificationName(getJavaClassName(getReferenceClass()));
        }
       
        // Process a converter for value column of this mapping.
        processMappingValueConverter(mapping, getValueConverter(), getConverts(), getReferenceClass(), getReferenceClassWithGenerics());
    }
View Full Code Here

     */
    protected void processDirectMapMapping() {
        // Initialize and process common direct collection metadata. This must
        // be done before any field processing since field processing requires
        // that the collection table be processed before hand.
        DirectMapMapping mapping = new DirectMapMapping();
        process(mapping);
       
        // Process the container and indirection policies.
        processContainerPolicyAndIndirection(mapping);
       
        // Process the key column (we must process this field before the
        // call to processConverter, since it may set a field classification)
        mapping.setDirectKeyField(getDatabaseField(getReferenceDatabaseTable(), MetadataLogger.MAP_KEY_COLUMN));
       
        // Only process the key converter if this is a basic map accessor. The
        // key converter for an element collection case will be taken care of
        // in the processContainerPolicyAndIndirection call above.
        if (isBasicMap()) {
            // To resolve any generic types (or respect an attribute type
            // specification) we need to set the attribute classification on the
            // mapping to ensure we do the right conversions.
            if (hasAttributeType() || getAccessibleObject().isGenericCollectionType()) {
                mapping.setDirectKeyFieldClassificationName(getJavaClassName(getMapKeyReferenceClass()));
            }
           
            // Process a converter for the key column of this mapping.
            processMappingKeyConverter(mapping, getKeyConverter(), null, getMapKeyReferenceClass(), getMapKeyReferenceClassWithGenerics());
        }
       
        // Process the value column (we must process this field before the call
        // to processConverter, since it may set a field classification)
        mapping.setDirectField(getDatabaseField(getReferenceDatabaseTable(), MetadataLogger.VALUE_COLUMN));
       
        // To resolve any generic types (or respect an attribute type
        // specification) we need to set the attribute classification on the
        // mapping to ensure we do the right conversions.
        if (hasAttributeType() || getAccessibleObject().isGenericCollectionType()) {
            mapping.setDirectFieldClassificationName(getJavaClassName(getReferenceClass()));
        }
       
        // Process a converter for value column of this mapping.
        processMappingValueConverter(mapping, getValueConverter(), getConverts(), getReferenceClass(), getReferenceClassWithGenerics());
    }
View Full Code Here

    Declaration declaration = queryContext.findDeclaration(identificationVariable.getVariableName());
    DatabaseMapping mapping = declaration.getMapping();

    if (mapping.isDirectMapMapping()) {

      DirectMapMapping mapMapping = (DirectMapMapping) mapping;
      type = mapMapping.getValueClass();

      if (type == null) {
        type = mapMapping.getDirectField().getType();
      }
    }
    else {
      type = calculateMappingType(declaration.getMapping());
    }
View Full Code Here

                m.setConverter(this);
                m.setFieldClassification(fieldClassification);
                m.setFieldClassificationClassName(fieldClassificationName);
            }
        } else if (mapping.isDirectMapMapping() && isForMapKey) {
            DirectMapMapping m = (DirectMapMapping) mapping;
           
            if (disableConversion) {
                m.setKeyConverter(null);
            } else {
                m.setKeyConverter(this);
                m.setDirectKeyFieldClassification(fieldClassification);
                m.setDirectKeyFieldClassificationName(fieldClassificationName);
            }
        }  else if (mapping.isDirectCollectionMapping()) {
            DirectCollectionMapping m = (DirectCollectionMapping) mapping;
           
            if (disableConversion) {
                m.setValueConverter(null);
            } else {
                m.setValueConverter(this);
                m.setDirectFieldClassification(fieldClassification);
                m.setDirectFieldClassificationName(fieldClassificationName);
            }
        } else {
            // TODO: what else could it be???
        }
    }
View Full Code Here

     */
    protected void processDirectMapMapping() {
        // Initialize and process common direct collection metadata. This must
        // be done before any field processing since field processing requires
        // that the collection table be processed before hand.
        DirectMapMapping mapping = new DirectMapMapping();
        process(mapping);
       
        // Process the container and indirection policies.
        processContainerPolicyAndIndirection(mapping);
       
        // Process the key column (we must process this field before the
        // call to processConverter, since it may set a field classification)
        mapping.setDirectKeyField(getDatabaseField(getReferenceDatabaseTable(), MetadataLogger.MAP_KEY_COLUMN));
       
        // Only process the key converter is this is a basic map accessor. The
        // key converter for an element collection case will be taken care of
        // in the processContainerPolicyAndIndirection call above.
        if (isBasicMap()) {
            // Process a converter for the key column of this mapping.
            processMappingKeyConverter(mapping, getKeyConverter(), getMapKeyReferenceClass());
        }
       
        // Process the value column (we must process this field before the call
        // to processConverter, since it may set a field classification)
        mapping.setDirectField(getDatabaseField(getReferenceDatabaseTable(), MetadataLogger.VALUE_COLUMN));
       
        // Process a converter for value column of this mapping.
        processMappingValueConverter(mapping, getValueConverter(), getReferenceClass());   
    }
View Full Code Here

            DirectToFieldMapping m = (DirectToFieldMapping) mapping;
            m.setConverter(this);
            m.setFieldClassification(fieldClassification);
            m.setFieldClassificationClassName(fieldClassificationName);
        } else if (mapping.isDirectMapMapping() && isForMapKey) {
            DirectMapMapping m = (DirectMapMapping) mapping;
            m.setKeyConverter(this);
            m.setDirectKeyFieldClassification(fieldClassification);
            m.setDirectKeyFieldClassificationName(fieldClassificationName);
        else if (mapping.isDirectCollectionMapping()) {
            DirectCollectionMapping m = (DirectCollectionMapping) mapping;
            m.setValueConverter(this);
            m.setDirectFieldClassification(fieldClassification);
            m.setDirectFieldClassificationName(fieldClassificationName);
        } else {
            // TODO: what else could it be???
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.mappings.DirectMapMapping

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.