Package org.apache.torque.templates.typemapping

Examples of org.apache.torque.templates.typemapping.SqlType


     */
    private void initialize()
    {
        setSchemaTypeToSqlTypeMapping(
                SchemaType.NUMERIC,
                new SqlType("DECIMAL"));
        setSchemaTypeToSqlTypeMapping(
                SchemaType.LONGVARCHAR,
                new SqlType("MEDIUMTEXT"));
        setSchemaTypeToSqlTypeMapping(
                SchemaType.TIMESTAMP,
                new SqlType("DATETIME"));
        setSchemaTypeToSqlTypeMapping(
                SchemaType.BINARY,
                new SqlType("BLOB"));
        setSchemaTypeToSqlTypeMapping(
                SchemaType.VARBINARY,
                new SqlType("MEDIUMBLOB"));
        setSchemaTypeToSqlTypeMapping(
                SchemaType.LONGVARBINARY,
                new SqlType("LONGBLOB"));
        setSchemaTypeToSqlTypeMapping(
                SchemaType.BLOB,
                new SqlType("LONGBLOB"));
        setSchemaTypeToSqlTypeMapping(
                SchemaType.CLOB,
                new SqlType("LONGTEXT"));
    }
View Full Code Here


    protected void setDomainAttributes(
                SourceElement columnElement,
                ControllerState controllerState)
            throws SourceTransformerException
    {
        SqlType domain = SchemaTypeHelper.getDomain(
                columnElement,
                controllerState);
        if (domain == null)
        {
            return;
        }
        if (columnElement.getAttribute(TorqueSchemaAttributeName.TYPE)
                    == null
                && domain.getSqlTypeName() != null)
        {
            columnElement.setAttribute(
                    TorqueSchemaAttributeName.TYPE,
                    domain.getSqlTypeName());
        }
        if (columnElement.getAttribute(TorqueSchemaAttributeName.DEFAULT)
                    == null
                && domain.getDefaultValue() != null)
        {
            columnElement.setAttribute(
                    TorqueSchemaAttributeName.DEFAULT,
                    domain.getDefaultValue());
        }
        if (columnElement.getAttribute(TorqueSchemaAttributeName.SIZE) == null
              && domain.getSize() != null)
        {
            columnElement.setAttribute(
                    TorqueSchemaAttributeName.SIZE,
                    domain.getSize());
        }
        if (columnElement.getAttribute(TorqueSchemaAttributeName.SCALE) == null
              && domain.getScale() != null)
        {
            columnElement.setAttribute(
                    TorqueSchemaAttributeName.SCALE,
                    domain.getScale());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.torque.templates.typemapping.SqlType

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.