Examples of JDBCValueClassMetaData


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

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: {
                    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

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

        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

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

                    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

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

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

        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

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

                    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

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCValueClassMetaData

      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())
      {
View Full Code Here

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCValueClassMetaData

      }
      else
      {

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

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCValueClassMetaData

/* 378 */     this.userTypeMappings = userTypeMappings;
/*     */
/* 380 */     HashMap valueClassesByType = new HashMap();
/* 381 */     for (Iterator i = valueClasses.iterator(); i.hasNext(); )
/*     */     {
/* 383 */       JDBCValueClassMetaData valueClass = (JDBCValueClassMetaData)i.next();
/* 384 */       valueClassesByType.put(valueClass.getJavaType(), valueClass);
/*     */     }
/*     */
/* 389 */     for (Iterator i = valueClasses.iterator(); i.hasNext(); )
/*     */     {
/* 391 */       JDBCValueClassMetaData valueClass = (JDBCValueClassMetaData)i.next();
/* 392 */       JDBCTypeComplex type = createTypeComplex(valueClass, valueClassesByType);
/* 393 */       this.complexTypes.put(valueClass.getJavaType(), type);
/*     */     }
/*     */
/* 396 */     Iterator i = typeMapping.getMappings().iterator();
/* 397 */     while (i.hasNext())
/*     */     {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.