Package org.apache.torque.generator.source.transform

Examples of org.apache.torque.generator.source.transform.SourceTransformerException


                SourceElement transformedElement = sourceTransformer.transform(
                        sourceElement,
                        controllerState);
                if (transformedElement == null)
                {
                    throw new SourceTransformerException("Transformer "
                            + sourceTransformer.getClass().getName()
                            + " returned null for element "
                            + sourceElement.getName());
                }
                SourceElement parent = sourceElement.getParent();
View Full Code Here


        String columnNameFromSchema
                = (String) columnElement.getAttribute(
                        TorqueSchemaAttributeName.NAME);
        if (columnNameFromSchema == null)
        {
            throw new SourceTransformerException("The attribute "
                    + TorqueSchemaAttributeName.NAME.getName()
                    + " on element "
                    + columnElement.getName()
                    + " is null");
        }

        SchemaType schemaType = null;
        SqlType domain = getDomain(columnElement, controllerState);
        if (domain != null && domain.getSqlTypeName() != null)
        {
            try
            {
                schemaType = SchemaType.valueOf(domain.getSqlTypeName());
            }
            catch (IllegalArgumentException e)
            {
                throw new SourceTransformerException("Unknown type "
                        + domain.getSqlTypeName()
                        + " in Domain definition");
            }
        }
        else
        {
            String schemaTypeString = (String) columnElement.getAttribute(
                    TorqueSchemaAttributeName.TYPE.getName());
            if (schemaTypeString == null)
            {
                throw new SourceTransformerException("type attribute not set"
                        + " in Column "
                        + columnNameFromSchema);
            }
            try
            {
                schemaType = SchemaType.valueOf(schemaTypeString);
            }
            catch (IllegalArgumentException e)
            {
                throw new SourceTransformerException("Unknown type "
                        + schemaTypeString
                        + " in Column "
                        + columnNameFromSchema);
            }
        }
View Full Code Here

                }
            }
        }
        if (domainElement == null)
        {
            throw new SourceTransformerException("The domain named "
                    + domainNameFromSchema
                    + " referenced by the column "
                    + columnElement.getParent().getAttribute(
                            TorqueSchemaAttributeName.NAME)
                    + " in the table "
View Full Code Here

            catch (SourceException e)
            {
                log.error("Could not construct source from schema file "
                        + externalSchemaPath,
                    e);
                throw new SourceTransformerException(e);
            }
        }
        // add own tables to root's all-tables
        for (SourceElement table
                : root.getChildren(TorqueSchemaElementName.TABLE))
View Full Code Here

            catch (SourceException e)
            {
                log.error("Could not construct source from schema file "
                        + includeSchemaPath,
                    e);
                throw new SourceTransformerException(e);
            }
        }
        return root;
    }
View Full Code Here

        {
            Object defaultIdMethod = tableElement.getParent().getAttribute(
                    TorqueSchemaAttributeName.DEFAULT_ID_METHOD.getName());
            if (defaultIdMethod == null)
            {
                throw new SourceTransformerException("id Method is not set"
                        + " on table "
                        + tableElement.getAttribute(
                                TorqueSchemaAttributeName.NAME.getName())
                        + " and defaultIdMethod is not set on database");
            }
View Full Code Here

        }
        else
        {
            String columnName = (String) columnElement.getAttribute(
                    TorqueSchemaAttributeName.NAME);
            throw new SourceTransformerException("Unknown javaType "
                    + javaType
                    + " in column "
                    + columnName);
        }
        return result;
View Full Code Here

        String columnName
                = (String) columnElement.getAttribute(
                        TorqueSchemaAttributeName.NAME);
        if (columnName == null)
        {
            throw new SourceTransformerException("The attribute "
                    + TorqueSchemaAttributeName.NAME.getName()
                    + " on element "
                    + columnElement.getName()
                    + " is null");
        }
View Full Code Here

            dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
            return dateFormat.parse(defaultValue);
        }
        catch (ParseException e)
        {
            throw new SourceTransformerException(
                "The default value "
                    + defaultValue
                    + " does not match the format String "
                    + DEFAULT_DATE_FORMAT
                    + " for date values");
View Full Code Here

            {
                fieldDefaultValue = "'\0'";
            }
            else
            {
                throw new SourceTransformerException(
                        "unknown primitive type" + javaType);
            }
        }
        else
        {
View Full Code Here

TOP

Related Classes of org.apache.torque.generator.source.transform.SourceTransformerException

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.