Package org.eclipse.persistence.mappings.converters

Examples of org.eclipse.persistence.mappings.converters.TypeConversionConverter


    protected void processLob(DatabaseMapping mapping) {
        // Set the field classification type on the mapping based on the
        // referenceClass type.
        if (isValidClobType(getReferenceClass())) {
            setFieldClassification(mapping, java.sql.Clob.class);  
            setConverter(mapping, new TypeConversionConverter(mapping));
        } else if (isValidBlobType(getReferenceClass())) {
            setFieldClassification(mapping, java.sql.Blob.class);
            setConverter(mapping, new TypeConversionConverter(mapping));
        } else if (Helper.classImplementsInterface(getReferenceClass(), Serializable.class)) {
            setFieldClassification(mapping, java.sql.Blob.class);
            setConverter(mapping, new SerializedObjectConverter(mapping));
        } else {
            // The referenceClass is neither a valid BLOB or CLOB attribute.  
View Full Code Here


                    // Through annotation and XML validation, it must be
                    // TemporalType.TIMESTAMP and can't be anything else.
                    setFieldClassification(mapping, java.sql.Timestamp.class);
                }
               
                setConverter(mapping, new TypeConversionConverter(mapping));
            } else {
                throw ValidationException.invalidTypeForTemporalAttribute(getAttributeName(), getReferenceClass(), getJavaClass());
            }   
        }
    }
View Full Code Here

     */
    public void initialize(AbstractSession session) throws DescriptorException {
        super.initialize(session);
        if (this.getField() instanceof XMLField) {
            if(getValueConverter() instanceof TypeConversionConverter) {
                TypeConversionConverter converter = (TypeConversionConverter) getValueConverter();
                this.getField().setType(converter.getObjectClass());
            }
            String xpathString = ((XMLField)getField()).getXPath();
            if (this.isAbstractCompositeDirectCollectionMapping() && (xpathString.indexOf(XMLConstants.ATTRIBUTE) == -1) && (!xpathString.endsWith(XMLConstants.TEXT))) {           
                throw DescriptorException.invalidXpathForXMLDirectMapping(this);
            }           
View Full Code Here

     */
    public void initialize(AbstractSession session) throws DescriptorException {
        super.initialize(session);
        if (this.getField() instanceof XMLField) {
            if (valueConverter instanceof TypeConversionConverter) {
                TypeConversionConverter converter = (TypeConversionConverter) valueConverter;
                this.getField().setType(converter.getObjectClass());
            }
            String xpathString = ((XMLField) getField()).getXPath();
            if (this.isAbstractCompositeDirectCollectionMapping() && (xpathString.indexOf(XMLConstants.ATTRIBUTE) == -1) && (!xpathString.endsWith(XMLConstants.TEXT))) {
                throw DescriptorException.invalidXpathForXMLDirectMapping(this);
            }
View Full Code Here

    protected void processLob(DatabaseMapping mapping) {
        // Set the field classification type on the mapping based on the
        // referenceClass type.
        if (isValidClobType(getReferenceClass())) {
            setFieldClassification(mapping, java.sql.Clob.class);  
            setConverter(mapping, new TypeConversionConverter(mapping));
        } else if (isValidBlobType(getReferenceClass())) {
            setFieldClassification(mapping, java.sql.Blob.class);
            setConverter(mapping, new TypeConversionConverter(mapping));
        } else if (Helper.classImplementsInterface(getReferenceClass(), Serializable.class)) {
            setFieldClassification(mapping, java.sql.Blob.class);
            setConverter(mapping, new SerializedObjectConverter(mapping));
        } else {
            // The referenceClass is neither a valid BLOB or CLOB attribute.  
View Full Code Here

                    // Through annotation and XML validation, it must be
                    // TemporalType.TIMESTAMP and can't be anything else.
                    setFieldClassification(mapping, java.sql.Timestamp.class);
                }
               
                setConverter(mapping, new TypeConversionConverter(mapping));
            } else {
                throw ValidationException.invalidTypeForTemporalAttribute(getAttributeName(), getReferenceClass(), getJavaClass());
            }   
        }
    }
View Full Code Here

   
    /**
     * INTERNAL:
     */
    public void process(DatabaseMapping mapping, DirectAccessor accessor) {
        TypeConversionConverter converter = new TypeConversionConverter(mapping);
       
        // Process the data type and set the data class name.
        converter.setDataClassName(getDataType(accessor).getName());
       
        // Process the object type and set the object class name.
        converter.setObjectClassName(getObjectType(accessor).getName());
       
        // Set the converter on the mapping.
        accessor.setConverter(mapping, converter);
       
        // Set the field classification.
View Full Code Here

   
    /**
     * INTERNAL:
     */
    public void process(DatabaseMapping mapping, DirectAccessor accessor) {
        TypeConversionConverter converter = new TypeConversionConverter(mapping);
       
        // Process the data type and set the data class name.
        converter.setDataClassName(getDataType(accessor).getName());
       
        // Process the object type and set the object class name.
        converter.setObjectClassName(getObjectType(accessor).getName());
       
        // Set the converter on the mapping.
        accessor.setConverter(mapping, converter);
       
        // Set the field classification.
View Full Code Here

    protected void processLob(DatabaseMapping mapping) {
        // Set the field classification type on the mapping based on the
        // referenceClass type.
        if (isValidClobType(getReferenceClass())) {
            setFieldClassification(mapping, java.sql.Clob.class);  
            setConverter(mapping, new TypeConversionConverter(mapping));
        } else if (isValidBlobType(getReferenceClass())) {
            setFieldClassification(mapping, java.sql.Blob.class);
            setConverter(mapping, new TypeConversionConverter(mapping));
        } else if (Helper.classImplementsInterface(getReferenceClass(), Serializable.class)) {
            setFieldClassification(mapping, java.sql.Blob.class);
            setConverter(mapping, new SerializedObjectConverter(mapping));
        } else {
            // The referenceClass is neither a valid BLOB or CLOB attribute.  
View Full Code Here

                    // Through annotation and XML validation, it must be
                    // TemporalType.TIMESTAMP and can't be anything else.
                    setFieldClassification(mapping, java.sql.Timestamp.class);
                }
               
                setConverter(mapping, new TypeConversionConverter(mapping));
            } else {
                throw ValidationException.invalidTypeForTemporalAttribute(getAttributeName(), getReferenceClass(), getJavaClass());
            }   
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.mappings.converters.TypeConversionConverter

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.