Package net.sf.jsqlparser.statement.drop

Examples of net.sf.jsqlparser.statement.drop.Drop


                {if (true) return retval;}
    throw new Error("Missing return statement in function");
  }

  final public Drop Drop() throws ParseException {
        Drop drop = new Drop();
        Token tk = null;
        List dropArgs = new ArrayList();
    jj_consume_token(K_DROP);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case S_IDENTIFIER:
      tk = jj_consume_token(S_IDENTIFIER);
      break;
    case K_TABLE:
      tk = jj_consume_token(K_TABLE);
      break;
    case K_INDEX:
      tk = jj_consume_token(K_INDEX);
      break;
    default:
      jj_la1[151] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
      drop.setType(tk.image);
    tk = jj_consume_token(S_IDENTIFIER);
                            drop.setName(tk.image);
    label_35:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case S_IDENTIFIER:
        ;
        break;
      default:
        jj_la1[152] = jj_gen;
        break label_35;
      }
      tk = jj_consume_token(S_IDENTIFIER);
                             dropArgs.add(tk.image);
    }
                if (dropArgs.size() > 0)
                        drop.setParameters(dropArgs);
                {if (true) return drop;}
    throw new Error("Missing return statement in function");
  }
View Full Code Here


    super(arg0);
  }

  public void testDrop() throws JSQLParserException {
    String statement = "DROP TABLE mytab";
    Drop drop = (Drop) parserManager.parse(new StringReader(statement));
    assertEquals("TABLE", drop.getType());
    assertEquals("mytab", drop.getName());
    assertEquals(statement, "" + drop);

    statement = "DROP INDEX myindex CASCADE";
    drop = (Drop) parserManager.parse(new StringReader(statement));
    assertEquals("INDEX", drop.getType());
    assertEquals("myindex", drop.getName());
    assertEquals("CASCADE", drop.getParameters().get(0));
    assertEquals(statement, "" + drop);
  }
View Full Code Here

TOP

Related Classes of net.sf.jsqlparser.statement.drop.Drop

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.