Examples of SQLPrimaryKey


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

                    } else if (lexer.token() == Token.UNIQUE) {
                        SQLAlterTableAddIndex item = parseAlterTableAddIndex();
                        item.setParent(stmt);
                        stmt.getItems().add(item);
                    } else if (lexer.token() == Token.PRIMARY) {
                        SQLPrimaryKey primaryKey = this.exprParser.parsePrimaryKey();
                        SQLAlterTableAddConstraint item = new SQLAlterTableAddConstraint(primaryKey);
                        stmt.getItems().add(item);
                    } else if (lexer.token() == Token.KEY) {
                        throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
                    } else if (lexer.token() == Token.CONSTRAINT) {
                        lexer.nextToken();
                        SQLName constraintName = this.exprParser.name();

                        if (lexer.token() == Token.PRIMARY) {
                            SQLPrimaryKey primaryKey = ((MySqlExprParser) this.exprParser).parsePrimaryKey();

                            primaryKey.setName(constraintName);

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

                            stmt.getItems().add(item);
View Full Code Here

Examples of org.sf.bee.persistence.sql.SQLPrimaryKey

        final String dbName = conn.getCatalog();
        final DatabaseMetaData metadata = conn.getMetaData();
        final ResultSet resultset = metadata.getPrimaryKeys(dbName, null, table);
        if (null != resultset) {
            while (resultset.next()) {
                final SQLPrimaryKey item = this.getKey(resultset);
                result.add(item);
            }
        }
        return result.toArray(new SQLPrimaryKey[result.size()]);
    }
View Full Code Here

Examples of org.sf.bee.persistence.sql.SQLPrimaryKey

        item.setName(resultset.getString(this.SCHEMA_CONSTANTS().getTABLE_NAME()));
        return item;
    }

    private SQLPrimaryKey getKey(final ResultSet resultset) throws SQLException {
        final SQLPrimaryKey item = new SQLPrimaryKey();
        item.setName(resultset.getString(PK_NAME));
        item.setColumnName(resultset.getString(COLUMN_NAME));
        item.setKeySeq(resultset.getString(KEY_SEQ));
       
        return item;
    }
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.