constaints.add(nullable);
return true;
}
if (lexer.token() == (Token.UNIQUE)) {
throw new ParserException("TODO");
}
if (lexer.token() == (Token.REFERENCE)) {
throw new ParserException("TODO");
}
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;
}
if (lexer.token() == (Token.SCHEMA)) {
throw new ParserException("TODO");
}
if (lexer.token() == (Token.PRIMARY)) {
lexer.nextToken();
accept(Token.KEY);
OraclePrimaryKey primaryKey = new OraclePrimaryKey();
primaryKey.setName(constaintName);
if (lexer.token() == (Token.LPAREN)) {
lexer.nextToken();
this.exprParser.names(primaryKey.getColumns());
accept(Token.RPAREN);
}
primaryKey.setState(parseConstraintState());
constaints.add(primaryKey);
return true;
}
if (identifierEquals("SCOPE")) {
lexer.nextToken();
if (lexer.token() == (Token.IS)) {
throw new RuntimeException("TODO");
}
if (identifierEquals("FOR")) {
throw new ParserException("TODO");
}
throw new ParserException("TODO");
}
if (identifierEquals("REF")) {
throw new ParserException("TODO");
}
if (identifierEquals("References")) {
lexer.nextToken();
OracleReferencesConstaint ref = new OracleReferencesConstaint();