Package org.eclipse.persistence.mappings

Examples of org.eclipse.persistence.mappings.DirectToFieldMapping


     * INTERNAL:
     * Set the DatabaseField that will represent the key in a DirectMapMapping.
     */
    public void setKeyField(DatabaseField keyField, ClassDescriptor descriptor) {
        if (keyMapping == null) {
            AbstractDirectMapping newKeyMapping = new DirectToFieldMapping();
            newKeyMapping.setField(keyField);
            newKeyMapping.setDescriptor(descriptor);
            setKeyMapping(newKeyMapping);
        }
        if (((DatabaseMapping)keyMapping).isDirectToFieldMapping()) {
            ((AbstractDirectMapping)keyMapping).setField(keyField);;
        }
View Full Code Here


            throw ValidationException.classNotFoundWhileConvertingClassNames(attributeConverterClassName, exception);
        }
       
        // Ensure the mapping has the correct field classification set.
        if (mapping.isDirectToFieldMapping()) {
            DirectToFieldMapping m = (DirectToFieldMapping) mapping;
            m.setConverter(converter);
            m.setFieldClassification(fieldClassification);
            m.setFieldClassificationClassName(fieldClassificationName);
        } else if (mapping.isDirectMapMapping() && isForMapKey) {
            DirectMapMapping m = (DirectMapMapping) mapping;
            m.setKeyConverter(converter);
            m.setDirectKeyFieldClassification(fieldClassification);
            m.setDirectKeyFieldClassificationName(fieldClassificationName);
        else if (mapping.isDirectCollectionMapping()) {
            DirectCollectionMapping m = (DirectCollectionMapping) mapping;
            m.setValueConverter(converter);
            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.DirectToFieldMapping

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.