Package cc.concurrent.mango.exception

Examples of cc.concurrent.mango.exception.IncorrectSqlException


                    // 如果使用cache并且sql中有一个in语句,mappedClass必须含有特定属性,必须a in (...),则mappedClass必须含有a属性
                    throw new NotReadablePropertyException("if use cache and sql has one in clause, property "
                            + interableProperty + " of " + mappedClass + " expected readable but not");
                }
            } else if (aips.size() != 0) {
                throw new IncorrectSqlException("if use cache, sql's in clause expected less than or equal 1 but "
                        + aips.size()); // 如果使用cache,sql中的in语句不能超过1
            }
        }
    }
View Full Code Here


        if (node instanceof ValuableParameter) {
            valuableParameters.add((ValuableParameter) node);
        }
        if (node instanceof ASTTable) {
            if (tableNode != null) {
                throw new IncorrectSqlException("too many #table in sql");
            }
            tableNode = (ASTTable) node;
        }
    }
View Full Code Here

    @Override
    protected void dbInitPostProcessor() {
        List<ASTIterableParameter> ips = rootNode.getIterableParameters();
        if (ips.size() > 0) {
            throw new IncorrectSqlException("if use batch update, sql's in clause number expected 0 but " +
                    ips.size()); // sql中不能有in语句
        }
    }
View Full Code Here

            throw new IncorrectAnnotationException("each method expected one cc.concurrent.mango.SQL annotation " +
                    "but not found");
        }
        String sql = sqlAnno.value();
        if (Strings.isNullOrEmpty(sql)) {
            throw new IncorrectSqlException("sql is null or empty");
        }
        ASTRootNode rootNode = new Parser(sql).parse().reduce();
        SQLType sqlType = getSQLType(sql);

        Class<?> returnType = method.getReturnType();
View Full Code Here

        } else if (UPDATE_PATTERN.matcher(sql).find()) {
            return SQLType.UPDATE;
        } else if (SELECT_PATTERN.matcher(sql).find()) {
            return SQLType.SELECT;
        } else {
            throw new IncorrectSqlException("sql must start with INSERT or DELETE or UPDATE or SELECT");
        }
    }
View Full Code Here

    @Override
    protected void cacheInitPostProcessor() {
        if (isUseCache()) {
            List<ASTIterableParameter> ips = rootNode.getIterableParameters();
            if (ips.size() > 1) {
                throw new IncorrectSqlException("if use cache, sql's in clause expected less than or equal 1 but " +
                        ips.size()); // sql中不能有多个in语句
            }
        }
    }
View Full Code Here

    @Override
    protected void cacheInitPostProcessor() {
        if (isUseCache()) {
            List<ASTIterableParameter> ips = rootNode.getIterableParameters();
            if (ips.size() > 1) {
                throw new IncorrectSqlException("if use cache, sql's in clause expected less than or equal 1 but " +
                        ips.size()); // sql中不能有多个in语句
            }
        }
    }
View Full Code Here

        rootNode.checkType(context); // 检测sql中的参数是否和方法上的参数匹配
        checkCacheBy(rootNode); // 如果使用cache,检测cache参数

        List<ASTIterableParameter> aips = rootNode.getASTIterableParameters();
        if (aips.size() > 0) {
            throw new IncorrectSqlException("if use batch update, sql's in clause number expected 0 but " +
                    aips.size()); // sql中不能有in语句
        }
    }
View Full Code Here

            throw new IncorrectAnnotationException("each method expected one cc.concurrent.mango.SQL annotation " +
                    "but not found");
        }
        String sql = sqlAnno.value();
        if (Strings.isNullOrEmpty(sql)) {
            throw new IncorrectSqlException("sql is null or empty");
        }
        ASTRootNode rootNode = new Parser(sql).parse();
        SQLType sqlType = getSQLType(sql);

        if (sqlType == SQLType.SELECT) {
View Full Code Here

        } else if (UPDATE_PATTERN.matcher(sql).find()) {
            return SQLType.UPDATE;
        } else if (SELECT_PATTERN.matcher(sql).find()) {
            return SQLType.SELECT;
        } else {
            throw new IncorrectSqlException("sql must start with INSERT or DELETE or UPDATE or SELECT");
        }
    }
View Full Code Here

TOP

Related Classes of cc.concurrent.mango.exception.IncorrectSqlException

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.