Package org.jboss.as.cmp.jdbc.metadata

Examples of org.jboss.as.cmp.jdbc.metadata.JDBCValueClassMetaData


        return valueClasses;
    }

    private static JDBCValueClassMetaData parseValueClass(final XMLStreamReader reader, final ClassLoader classLoader) throws XMLStreamException {
        final Map<String, JDBCValuePropertyMetaData> properties = new HashMap<String, JDBCValuePropertyMetaData>();
        final JDBCValueClassMetaData valueClass = new JDBCValueClassMetaData();
        for (Element element : children(reader)) {
            switch (element) {
                case CLASS: {
                    final String type = getElementText(reader);
                    try {
                        valueClass.setClass(classLoader.loadClass(type));
                    } catch (ClassNotFoundException e) {
                        throw MESSAGES.failedToLoadValueClass(type, e);
                    }
                    break;
                }
                case PROPERTY: {
                    parseValueProperty(reader, properties);
                    break;
                }
                case DESCRIPTION: {
                    getElementText(reader);
                    break;
                }
                default: {
                    throw unexpectedElement(reader);
                }
            }
        }

        for (String propertyName : properties.keySet()) {
            final JDBCValuePropertyMetaData propertyMetaData = properties.get(propertyName);
            propertyMetaData.setPropertyName(propertyName, valueClass.getJavaType());
            valueClass.addProperty(propertyMetaData);
        }
        return valueClass;
    }
View Full Code Here


        return valueClasses;
    }

    private static JDBCValueClassMetaData parseValueClass(final XMLStreamReader reader, final ClassLoader classLoader) throws XMLStreamException {
        final Map<String, JDBCValuePropertyMetaData> properties = new HashMap<String, JDBCValuePropertyMetaData>();
        final JDBCValueClassMetaData valueClass = new JDBCValueClassMetaData();
        for (Element element : children(reader)) {
            switch (element) {
                case CLASS: {
                    try {
                        valueClass.setClass(classLoader.loadClass(getElementText(reader)));
                    } catch (ClassNotFoundException e) {
                        throw new RuntimeException("Failed to load value class", e);
                    }
                    break;
                }
                case PROPERTY: {
                    parseValueProperty(reader, properties);
                    break;
                }
                case DESCRIPTION: {
                    getElementText(reader);
                    break;
                }
                default: {
                    throw unexpectedElement(reader);
                }
            }
        }

        for (String propertyName : properties.keySet()) {
            final JDBCValuePropertyMetaData propertyMetaData = properties.get(propertyName);
            propertyMetaData.setPropertyName(propertyName, valueClass.getJavaType());
            valueClass.addProperty(propertyMetaData);
        }
        return valueClass;
    }
View Full Code Here

        this.typeMapping = typeMapping;
        this.userTypeMappings = userTypeMappings;

        HashMap valueClassesByType = new HashMap();
        for (Iterator i = valueClasses.iterator(); i.hasNext(); ) {
            JDBCValueClassMetaData valueClass = (JDBCValueClassMetaData) i.next();
            valueClassesByType.put(valueClass.getJavaType(), valueClass);
        }


        // convert the value class meta data to a jdbc complex type
        for (Iterator i = valueClasses.iterator(); i.hasNext(); ) {
            JDBCValueClassMetaData valueClass = (JDBCValueClassMetaData) i.next();
            JDBCTypeComplex type = createTypeComplex(valueClass, valueClassesByType);
            complexTypes.put(valueClass.getJavaType(), type);
        }

        Iterator i = typeMapping.getMappings().iterator();
        while (i.hasNext()) {
            JDBCMappingMetaData mapping = (JDBCMappingMetaData) i.next();
View Full Code Here

                    setters));

        } else {

            // this property is a value object, recurse
            JDBCValueClassMetaData valueClass =
                    (JDBCValueClassMetaData) valueClassesByType.get(javaType);
            properties.addAll(createComplexProperties(
                    valueClass,
                    valueClassesByType,
                    propertyStack));
View Full Code Here

        return valueClasses;
    }

    private static JDBCValueClassMetaData parseValueClass(final XMLStreamReader reader, final ClassLoader classLoader) throws XMLStreamException {
        final Map<String, JDBCValuePropertyMetaData> properties = new HashMap<String, JDBCValuePropertyMetaData>();
        final JDBCValueClassMetaData valueClass = new JDBCValueClassMetaData();
        for (Element element : children(reader)) {
            switch (element) {
                case CLASS: {
                    final String type = getElementText(reader);
                    try {
                        valueClass.setClass(classLoader.loadClass(type));
                    } catch (ClassNotFoundException e) {
                        throw MESSAGES.failedToLoadValueClass(type, e);
                    }
                    break;
                }
                case PROPERTY: {
                    parseValueProperty(reader, properties);
                    break;
                }
                case DESCRIPTION: {
                    getElementText(reader);
                    break;
                }
                default: {
                    throw unexpectedElement(reader);
                }
            }
        }

        for (String propertyName : properties.keySet()) {
            final JDBCValuePropertyMetaData propertyMetaData = properties.get(propertyName);
            propertyMetaData.setPropertyName(propertyName, valueClass.getJavaType());
            valueClass.addProperty(propertyMetaData);
        }
        return valueClass;
    }
View Full Code Here

        this.typeMapping = typeMapping;
        this.userTypeMappings = userTypeMappings;

        HashMap valueClassesByType = new HashMap();
        for (Iterator i = valueClasses.iterator(); i.hasNext(); ) {
            JDBCValueClassMetaData valueClass = (JDBCValueClassMetaData) i.next();
            valueClassesByType.put(valueClass.getJavaType(), valueClass);
        }


        // convert the value class meta data to a jdbc complex type
        for (Iterator i = valueClasses.iterator(); i.hasNext(); ) {
            JDBCValueClassMetaData valueClass = (JDBCValueClassMetaData) i.next();
            JDBCTypeComplex type = createTypeComplex(valueClass, valueClassesByType);
            complexTypes.put(valueClass.getJavaType(), type);
        }

        Iterator i = typeMapping.getMappings().iterator();
        while (i.hasNext()) {
            JDBCMappingMetaData mapping = (JDBCMappingMetaData) i.next();
View Full Code Here

                    setters));

        } else {

            // this property is a value object, recurse
            JDBCValueClassMetaData valueClass =
                    (JDBCValueClassMetaData) valueClassesByType.get(javaType);
            properties.addAll(createComplexProperties(
                    valueClass,
                    valueClassesByType,
                    propertyStack));
View Full Code Here

TOP

Related Classes of org.jboss.as.cmp.jdbc.metadata.JDBCValueClassMetaData

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.