use of com.alibaba.druid.sql.dialect.oracle.ast.clause.OracleStorageClause.FlashCacheType in project druid by alibaba.
the class OracleExprParser method parseStorage.
public OracleStorageClause parseStorage() {
lexer.nextToken();
accept(Token.LPAREN);
OracleStorageClause storage = new OracleStorageClause();
for (; ; ) {
if (identifierEquals("INITIAL")) {
lexer.nextToken();
storage.setInitial(this.expr());
continue;
} else if (lexer.token() == Token.NEXT) {
lexer.nextToken();
storage.setNext(this.expr());
continue;
} else if (lexer.token() == Token.MINEXTENTS) {
lexer.nextToken();
storage.setMinExtents(this.expr());
continue;
} else if (lexer.token() == Token.MAXEXTENTS) {
lexer.nextToken();
storage.setMaxExtents(this.expr());
continue;
} else if (lexer.token() == Token.MAXSIZE) {
lexer.nextToken();
storage.setMaxSize(this.expr());
continue;
} else if (lexer.token() == Token.PCTINCREASE) {
lexer.nextToken();
storage.setPctIncrease(this.expr());
continue;
} else if (identifierEquals("FREELISTS")) {
lexer.nextToken();
storage.setFreeLists(this.expr());
continue;
} else if (identifierEquals("FREELIST")) {
lexer.nextToken();
acceptIdentifier("GROUPS");
storage.setFreeListGroups(this.expr());
continue;
} else if (identifierEquals("BUFFER_POOL")) {
lexer.nextToken();
storage.setBufferPool(this.expr());
continue;
} else if (identifierEquals("OBJNO")) {
lexer.nextToken();
storage.setObjno(this.expr());
continue;
} else if (lexer.token() == Token.FLASH_CACHE) {
lexer.nextToken();
FlashCacheType flashCacheType;
if (lexer.token() == Token.KEEP) {
flashCacheType = FlashCacheType.KEEP;
lexer.nextToken();
} else if (lexer.token() == Token.NONE) {
flashCacheType = FlashCacheType.NONE;
lexer.nextToken();
} else {
accept(Token.DEFAULT);
flashCacheType = FlashCacheType.DEFAULT;
}
storage.setFlashCache(flashCacheType);
continue;
} else if (lexer.token() == Token.CELL_FLASH_CACHE) {
lexer.nextToken();
FlashCacheType flashCacheType;
if (lexer.token() == Token.KEEP) {
flashCacheType = FlashCacheType.KEEP;
lexer.nextToken();
} else if (lexer.token() == Token.NONE) {
flashCacheType = FlashCacheType.NONE;
lexer.nextToken();
} else {
accept(Token.DEFAULT);
flashCacheType = FlashCacheType.DEFAULT;
}
storage.setCellFlashCache(flashCacheType);
continue;
}
break;
}
accept(Token.RPAREN);
return storage;
}
Aggregations