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

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


        return data;
    }

    public Object visit(ASTConcat node, Object data) {
        StringBuffer buf = (StringBuffer) data;
        JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.CONCAT);
        Object[] args = childrenToStringArr(2, node);
        function.getFunctionSql(args, buf);
        return data;
    }
View Full Code Here


        return data;
    }

    public Object visit(ASTSubstring node, Object data) {
        StringBuffer buf = (StringBuffer) data;
        JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.SUBSTRING);
        Object[] args = childrenToStringArr(3, node);
        function.getFunctionSql(args, buf);
        return data;
    }
View Full Code Here

        return data;
    }

    public Object visit(ASTUCase node, Object data) {
        StringBuffer buf = (StringBuffer) data;
        JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.UCASE);
        Object[] args = childrenToStringArr(1, node);
        function.getFunctionSql(args, buf);
        return data;
    }
View Full Code Here

        return data;
    }

    public Object visit(ASTLCase node, Object data) {
        StringBuffer buf = (StringBuffer) data;
        JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.LCASE);
        Object[] args = childrenToStringArr(1, node);
        function.getFunctionSql(args, buf);
        return data;
    }
View Full Code Here

        return data;
    }

    public Object visit(ASTLength node, Object data) {
        StringBuffer buf = (StringBuffer) data;
        JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.LENGTH);
        Object[] args = childrenToStringArr(1, node);
        function.getFunctionSql(args, buf);
        return data;
    }
View Full Code Here

        return data;
    }

    public Object visit(ASTLocate node, Object data) {
        StringBuffer buf = (StringBuffer) data;
        JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.LOCATE);
        Object[] args = new Object[3];
        args[0] = node.jjtGetChild(0).jjtAccept(this, new StringBuffer()).toString();
        args[1] = node.jjtGetChild(1).jjtAccept(this, new StringBuffer()).toString();
        if (node.jjtGetNumChildren() == 3) {
            args[2] = node.jjtGetChild(2).jjtAccept(this, new StringBuffer()).toString();
        } else {
            args[2] = "1";
        }
        function.getFunctionSql(args, buf);
        return data;
    }
View Full Code Here

        return data;
    }

    public Object visit(ASTAbs node, Object data) {
        StringBuffer buf = (StringBuffer) data;
        JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.ABS);
        Object[] args = childrenToStringArr(1, node);
        function.getFunctionSql(args, buf);
        return data;
    }
View Full Code Here

        return data;
    }

    public Object visit(ASTSqrt node, Object data) {
        StringBuffer buf = (StringBuffer) data;
        JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.SQRT);
        Object[] args = childrenToStringArr(1, node);
        function.getFunctionSql(args, buf);
        return data;
    }
View Full Code Here

        return data;
    }

    public Object visit(ASTMod node, Object data) {
        StringBuffer buf = (StringBuffer) data;
        JDBCFunctionMappingMetaData function = typeMapping.getFunctionMapping(JDBCTypeMappingMetaData.MOD);
        Object[] args = childrenToStringArr(2, node);
        function.getFunctionSql(args, buf);
        return data;
    }
View Full Code Here

            addField(type, sql);
        }

        // add a pk constraint
        if (entityMetaData.hasPrimaryKeyConstraint()) {
            JDBCFunctionMappingMetaData pkConstraint = manager.getMetaData().getTypeMapping().getPkConstraintTemplate();
            if (pkConstraint == null) {
                throw new IllegalStateException("Primary key constraint is " +
                        "not allowed for this type of data source");
            }

            String defTableName = entity.getManager().getMetaData().getDefaultTableName();
            String name = "pk_" + SQLUtil.unquote(defTableName, dataSource);
            name = SQLUtil.fixConstraintName(name, dataSource);
            String[] args = new String[]{
                    name,
                    SQLUtil.getColumnNamesClause(entity.getPrimaryKeyFields(), new StringBuffer(100)).toString()
            };
            sql.append(SQLUtil.COMMA);
            pkConstraint.getFunctionSql(args, sql);
        }

        return sql.append(')').toString();
    }
View Full Code Here

TOP

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

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.