Package net.sf.jsqlparser.statement.create.index

Examples of net.sf.jsqlparser.statement.create.index.CreateIndex


  }

  public void testCreateIndex() throws JSQLParserException {
    String statement =
      "CREATE INDEX myindex ON mytab (mycol, mycol2)";
    CreateIndex createIndex = (CreateIndex) parserManager.parse(new StringReader(statement));
    assertEquals(2, createIndex.getIndex().getColumnsNames().size());
    assertEquals("myindex", createIndex.getIndex().getName());
    assertNull(createIndex.getIndex().getType());
    assertEquals("mytab", createIndex.getTable().getFullyQualifiedName());
    assertEquals("mycol", createIndex.getIndex().getColumnsNames().get(0));
    assertEquals(statement, ""+createIndex);
  }
View Full Code Here


  }

  public void testCreateIndex2() throws JSQLParserException {
    String statement =
      "CREATE mytype INDEX myindex ON mytab (mycol, mycol2)";
    CreateIndex createIndex = (CreateIndex) parserManager.parse(new StringReader(statement));
    assertEquals(2, createIndex.getIndex().getColumnsNames().size());
    assertEquals("myindex", createIndex.getIndex().getName());
    assertEquals("mytype", createIndex.getIndex().getType());
    assertEquals("mytab", createIndex.getTable().getFullyQualifiedName());
    assertEquals("mycol2", createIndex.getIndex().getColumnsNames().get(1));
    assertEquals(statement, ""+createIndex);
  }
View Full Code Here

  }

  public void testCreateIndex3() throws JSQLParserException {
    String statement =
      "CREATE mytype INDEX myindex ON mytab (mycol ASC, mycol2, mycol3)";
    CreateIndex createIndex = (CreateIndex) parserManager.parse(new StringReader(statement));
    assertEquals(3, createIndex.getIndex().getColumnsNames().size());
    assertEquals("myindex", createIndex.getIndex().getName());
    assertEquals("mytype", createIndex.getIndex().getType());
    assertEquals("mytab", createIndex.getTable().getFullyQualifiedName());
    assertEquals("mycol3", createIndex.getIndex().getColumnsNames().get(2));
  }
View Full Code Here

  }

  public void testCreateIndex4() throws JSQLParserException {
    String statement =
      "CREATE mytype INDEX myindex ON mytab (mycol ASC, mycol2 (75), mycol3)";
    CreateIndex createIndex = (CreateIndex) parserManager.parse(new StringReader(statement));
    assertEquals(3, createIndex.getIndex().getColumnsNames().size());
    assertEquals("myindex", createIndex.getIndex().getName());
    assertEquals("mytype", createIndex.getIndex().getType());
    assertEquals("mytab", createIndex.getTable().getFullyQualifiedName());
    assertEquals("mycol3", createIndex.getIndex().getColumnsNames().get(2));
  }
View Full Code Here

  }

  public void testCreateIndex5() throws JSQLParserException {
    String statement =
      "CREATE mytype INDEX myindex ON mytab (mycol ASC, mycol2 (75), mycol3) mymodifiers";
    CreateIndex createIndex = (CreateIndex) parserManager.parse(new StringReader(statement));
    assertEquals(3, createIndex.getIndex().getColumnsNames().size());
    assertEquals("myindex", createIndex.getIndex().getName());
    assertEquals("mytype", createIndex.getIndex().getType());
    assertEquals("mytab", createIndex.getTable().getFullyQualifiedName());
    assertEquals("mycol3", createIndex.getIndex().getColumnsNames().get(2));
  }
View Full Code Here

TOP

Related Classes of net.sf.jsqlparser.statement.create.index.CreateIndex

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.