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

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


        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

        selectDistinct = ((ASTSelect) selectNode).distinct || returnType == Set.class || forceDistinct;

        // assemble sql
        StringBuffer sql = (StringBuffer) data;
        if (selectManager.getMetaData().hasRowLocking() && !(selectObject instanceof SelectFunction)) {
            JDBCFunctionMappingMetaData rowLockingTemplate = typeMapping.getRowLockingTemplate();
            if (rowLockingTemplate == null) {
                throw CmpMessages.MESSAGES.rowLockingTemplateNotDefinedFor(typeMapping.getName());
            }

            boolean distinct = selectDistinct;

            Object[] args = new Object[]{
                    distinct ? SQLUtil.DISTINCT + selectClause : selectClause.toString(),
                    fromClause,
                    whereClause == null || whereClause.length() == 0 ? null : whereClause,
                    orderByClause == null || orderByClause.length() == 0 ? null : orderByClause
            };
            rowLockingTemplate.getFunctionSql(args, sql);
        } else {
            sql.append(SQLUtil.SELECT);
            if (selectDistinct) {
                sql.append(SQLUtil.DISTINCT);
            }
View Full Code Here

        } else {
            relationTableAlias = "";
            relatedTableAlias = "";
        }

        JDBCFunctionMappingMetaData selectTemplate = getSelectTemplate(cmrField);
        return selectTemplate == null ?
                getPlainSQL(
                        keyCount,
                        myKeyFields,
                        relationTableAlias,
View Full Code Here

        }
    }

    private JDBCFunctionMappingMetaData getSelectTemplate(JDBCCMRFieldBridge cmrField) {

        JDBCFunctionMappingMetaData selectTemplate = null;
        if (cmrField.getRelationMetaData().isTableMappingStyle()) {
            // relation table
            if (cmrField.getRelationMetaData().hasRowLocking()) {
                selectTemplate =
                        cmrField.getRelationMetaData().getTypeMapping().getRowLockingTemplate();
View Full Code Here

        SQLUtil.getWhereClause(entity.getPrimaryKeyFields(), alias, where);

        // generate the sql
        StringBuffer sql = new StringBuffer(300);
        if (rowLocking && readAhead.isOnFind() && getEagerLoadMask() != null) {
            JDBCFunctionMappingMetaData rowLockingTemplate = typeMapping.getRowLockingTemplate();
            rowLockingTemplate.getFunctionSql(
                    new Object[]{
                            select,
                            from,
                            where.length() == 0 ? null : where,
                            null // order by
View Full Code Here

        if (entity.getMetaData().hasRowLocking()) {
            JDBCEntityPersistenceStore manager = entity.getManager();
            JDBCTypeFactory typeFactory = manager.getJDBCTypeFactory();
            JDBCTypeMappingMetaData typeMapping = typeFactory.getTypeMapping();
            JDBCFunctionMappingMetaData rowLockingTemplate = typeMapping.getRowLockingTemplate();
            if (rowLockingTemplate == null) {
                throw CmpMessages.MESSAGES.noRowLockingTemplateForMapping(typeMapping.getName());
            }

            selectSql = rowLockingTemplate.getFunctionSql(new Object[]{selectColumns, tableName, whereColumns, null},
                    new StringBuffer()).toString();
        } else {
            selectSql = "select ";
            selectSql += selectColumns;
            selectSql += " from " + tableName + " where ";
View Full Code Here

        if (entity.getMetaData().hasRowLocking()) {
            JDBCEntityPersistenceStore manager = entity.getManager();
            JDBCTypeFactory typeFactory = manager.getJDBCTypeFactory();
            JDBCTypeMappingMetaData typeMapping = typeFactory.getTypeMapping();
            JDBCFunctionMappingMetaData rowLockingTemplate = typeMapping.getRowLockingTemplate();

            if (rowLockingTemplate == null) {
                throw MESSAGES.noRowLockingTemplateForMapping(typeMapping.getName());
            }

            sql = rowLockingTemplate.getFunctionSql(
                    new Object[]{selectColumns, entity.getQualifiedTableName(), whereColumns, null}, new StringBuffer()
            ).toString();
        } else {
            sql = "select ";
            sql += selectColumns;
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.