Examples of SQLCharactorDataType


Examples of com.alibaba.druid.sql.ast.statement.SQLCharactorDataType

    protected SQLDataType parseCharTypeRest(SQLDataType dataType) {
        if (!isCharType(dataType)) {
            return dataType;
        }

        SQLCharactorDataType charType = new SQLCharactorDataType(dataType.getName());
        charType.getArguments().addAll(dataType.getArguments());

        if (identifierEquals("CHARACTER")) {
            lexer.nextToken();

            accept(Token.SET);

            if (lexer.token() != Token.IDENTIFIER) {
                throw new ParserException();
            }
            charType.setCharSetName(lexer.stringVal());
            lexer.nextToken();

            if (lexer.token() == Token.IDENTIFIER) {
                if (lexer.stringVal().equalsIgnoreCase("COLLATE")) {
                    lexer.nextToken();

                    if (lexer.token() != Token.IDENTIFIER) {
                        throw new ParserException();
                    }
                    charType.setCollate(lexer.stringVal());
                    lexer.nextToken();
                }
            }
        }
        return charType;
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLCharactorDataType

            printAndAccept(x.getArguments(), ", ");
            print(")");
        }

        if (x instanceof SQLCharactorDataType) {
            SQLCharactorDataType charType = (SQLCharactorDataType) x;
            if (charType.getCharSetName() != null) {
                print(" CHARACTER SET ");
                print(charType.getCharSetName());

                if (charType.getCollate() != null) {
                    print(" COLLATE ");
                    print(charType.getCollate());
                }
            }
        }
        return false;
    }
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLCharactorDataType

        }

        String typeName = lexer.stringVal();

        lexer.nextToken();
        SQLCharactorDataType dataType = new SQLCharactorDataType(typeName);
        if (lexer.token() == (Token.LPAREN)) {
            lexer.nextToken();
            exprList(dataType.getArguments());
            accept(Token.RPAREN);
        }

        if (lexer.token() != Token.IDENTIFIER) {
            throw new ParserException();
        }

        if (lexer.stringVal().equalsIgnoreCase("CHARACTER")) {
            if (lexer.token() != Token.IDENTIFIER) {
                throw new ParserException();
            }

            if (!lexer.stringVal().equalsIgnoreCase("SET")) {
                throw new ParserException();
            }

            if (lexer.token() != Token.IDENTIFIER) {
                throw new ParserException();
            }
            dataType.setCharSetName(lexer.stringVal());
            lexer.nextToken();

            if (lexer.token() == Token.IDENTIFIER) {
                if (lexer.stringVal().equalsIgnoreCase("COLLATE")) {
                    lexer.nextToken();

                    if (lexer.token() != Token.IDENTIFIER) {
                        throw new ParserException();
                    }
                    dataType.setCollate(lexer.stringVal());
                    lexer.nextToken();
                }
            }
        }
        return dataType;
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLCharactorDataType

            printAndAccept(x.getArguments(), ", ");
            print(")");
        }

        if (x instanceof SQLCharactorDataType) {
            SQLCharactorDataType charType = (SQLCharactorDataType) x;
            if (charType.getCharSetName() != null) {
                print(" CHARACTER SET ");
                print(charType.getCharSetName());

                if (charType.getCollate() != null) {
                    print(" COLLATE ");
                    print(charType.getCollate());
                }
            }
        }
        return false;
    }
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLCharactorDataType

           
            return timestamp;
        }
       
        if (isCharType(typeName)) {
            SQLCharactorDataType charType = new SQLCharactorDataType(typeName);
           
            if (lexer.token() == Token.LPAREN) {
                lexer.nextToken();
               
                charType.getArguments().add(this.expr());
               
                if (identifierEquals("CHAR")) {
                    lexer.nextToken();
                    charType.setCharType(SQLCharactorDataType.CHAR_TYPE_CHAR);
                } else if (identifierEquals("BYTE")) {
                    lexer.nextToken();
                    charType.setCharType(SQLCharactorDataType.CHAR_TYPE_BYTE);
                }
               
                accept(Token.RPAREN);
            }
           
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLCharactorDataType

        if (Boolean.TRUE == x.getAttribute("unsigned")) {
            print(" unsigned");
        }

        if (x instanceof SQLCharactorDataType) {
            SQLCharactorDataType charType = (SQLCharactorDataType) x;
            if (charType.getCharSetName() != null) {
                print(" CHARACTER SET ");
                print(charType.getCharSetName());

                if (charType.getCollate() != null) {
                    print(" COLLATE ");
                    print(charType.getCollate());
                }
            }
        }
        return false;
    }
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLCharactorDataType

        SQLName typeExpr = name();
        String typeName = typeExpr.toString();

        if (isCharType(typeName)) {
            SQLCharactorDataType charType = new SQLCharactorDataType(typeName);

            if (lexer.token() == Token.LPAREN) {
                lexer.nextToken();
                SQLExpr arg = this.expr();
                arg.setParent(charType);
                charType.getArguments().add(arg);
                accept(Token.RPAREN);
            }

            return parseCharTypeRest(charType);
        }
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLCharactorDataType

        SQLName typeExpr = name();
        String typeName = typeExpr.toString();

        if (isCharType(typeName)) {
            SQLCharactorDataType charType = new SQLCharactorDataType(typeName);

            if (lexer.token() == Token.LPAREN) {
                lexer.nextToken();
                SQLExpr arg = this.expr();
                arg.setParent(charType);
                charType.getArguments().add(arg);
                accept(Token.RPAREN);
            }

            return parseCharTypeRest(charType);
        }
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLCharactorDataType

        if (Boolean.TRUE == x.getAttribute("unsigned")) {
            print(" unsigned");
        }

        if (x instanceof SQLCharactorDataType) {
            SQLCharactorDataType charType = (SQLCharactorDataType) x;
            if (charType.getCharSetName() != null) {
                print(" CHARACTER SET ");
                print(charType.getCharSetName());

                if (charType.getCollate() != null) {
                    print(" COLLATE ");
                    print(charType.getCollate());
                }
            }
        }
        return false;
    }
View Full Code Here

Examples of com.alibaba.druid.sql.ast.statement.SQLCharactorDataType

        SQLName typeExpr = name();
        String typeName = typeExpr.toString();

        if (isCharType(typeName)) {
            SQLCharactorDataType charType = new SQLCharactorDataType(typeName);

            if (lexer.token() == Token.LPAREN) {
                lexer.nextToken();
                charType.getArguments().add(this.expr());
                accept(Token.RPAREN);
            }

            return parseCharTypeRest(charType);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.