if (lexer.token() == (Token.FOREIGN)) {
lexer.nextToken();
accept(Token.KEY);
OracleForeignKey foreignKey = new OracleForeignKey();
foreignKey.setName(constaintName);
accept(Token.LPAREN);
this.exprParser.names(foreignKey.getColumns());
accept(Token.RPAREN);
accept(Token.REFERENCE);
foreignKey.setRefObject(this.exprParser.name());
if (lexer.token() == (Token.LPAREN)) {
lexer.nextToken();
this.exprParser.names(foreignKey.getRefColumns());
accept(Token.RPAREN);
}
if (lexer.token() == (Token.ON)) {
lexer.nextToken();
accept(Token.DELETE);
if (identifierEquals("CASCADE")) {
throw new RuntimeException("TODO");
} else {
throw new RuntimeException("TODO");
}
}
foreignKey.setState(parseConstraintState());
constaints.add(foreignKey);
return true;
}