Package com.alibaba.druid.sql.dialect.mysql.ast

Examples of com.alibaba.druid.sql.dialect.mysql.ast.MySqlForeignKey


            uk.setHasConstaint(hasConstaint);
            return (SQLTableConstaint) uk;
        }

        if (lexer.token() == Token.FOREIGN) {
            MysqlForeignKey fk = this.getExprParser().parseForeignKey();
            fk.setName(name);
            fk.setHasConstaint(hasConstaint);
            return (SQLTableConstaint) fk;
        }

        throw new ParserException("TODO :" + lexer.token());
    }
View Full Code Here


                            SQLAlterTableAddConstraint item = new SQLAlterTableAddConstraint(primaryKey);
                            item.setParent(stmt);

                            stmt.getItems().add(item);
                        } else if (lexer.token() == Token.FOREIGN) {
                            MysqlForeignKey fk = this.getExprParser().parseForeignKey();
                            fk.setName(constraintName);
                            fk.setHasConstaint(true);

                            SQLAlterTableAddConstraint item = new SQLAlterTableAddConstraint(fk);

                            item.setParent(stmt);
View Full Code Here

            uk.setHasConstaint(hasConstaint);
            return (SQLTableConstaint) uk;
        }

        if (lexer.token() == Token.FOREIGN) {
            MysqlForeignKey fk = this.getExprParser().parseForeignKey();
            fk.setName(name);
            fk.setHasConstaint(hasConstaint);
            return (SQLTableConstaint) fk;
        }

        throw new ParserException("TODO :" + lexer.token());
    }
View Full Code Here

    public MysqlForeignKey parseForeignKey() {
        accept(Token.FOREIGN);
        accept(Token.KEY);

        MysqlForeignKey fk = new MysqlForeignKey();

        if (lexer.token() != Token.LPAREN) {
            SQLName indexName = name();
            fk.setIndexName(indexName);
        }

        accept(Token.LPAREN);
        this.names(fk.getReferencingColumns());
        accept(Token.RPAREN);

        accept(Token.REFERENCES);

        fk.setReferencedTableName(this.name());

        accept(Token.LPAREN);
        this.names(fk.getReferencedColumns());
        accept(Token.RPAREN);
        return fk;
    }
View Full Code Here

                            SQLAlterTableAddConstraint item = new SQLAlterTableAddConstraint(primaryKey);
                            item.setParent(stmt);

                            stmt.getItems().add(item);
                        } else if (lexer.token() == Token.FOREIGN) {
                            MysqlForeignKey fk = this.getExprParser().parseForeignKey();
                            fk.setName(constraintName);
                            fk.setHasConstraint(true);

                            SQLAlterTableAddConstraint item = new SQLAlterTableAddConstraint(fk);

                            item.setParent(stmt);
View Full Code Here

            uk.setHasConstaint(hasConstaint);
            return (SQLTableConstraint) uk;
        }

        if (lexer.token() == Token.FOREIGN) {
            MysqlForeignKey fk = this.getExprParser().parseForeignKey();
            fk.setName(name);
            fk.setHasConstraint(hasConstaint);
            return (SQLTableConstraint) fk;
        }

        throw new ParserException("TODO :" + lexer.token());
    }
View Full Code Here

TOP

Related Classes of com.alibaba.druid.sql.dialect.mysql.ast.MySqlForeignKey

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.