Examples of DBIndex


Examples of org.databene.jdbacl.model.DBIndex

  @Test
  public void testAllIndexColumnsReplaced() {
    // given an index consisting of two columns which are replaced in a newer index version
    DBTable table = createTableWithColumns("tbl", 4);
    DBIndex index1 = new DBNonUniqueIndex("idx", true, table, "col1", "col2");
    DBIndex index2 = new DBNonUniqueIndex("idx", true, table, "col3", "col4");
    TableChange tableChange = new TableChange(table, null);
    // when performing a comparison
    new IndexComparator(config).compareObjects(index1, index2, tableChange);
    // then the result must be deletion of the former index version and creation of the new one
    System.out.println(tableChange);
View Full Code Here

Examples of org.databene.jdbacl.model.DBIndex

 
  @Test
  public void testIndexColumnAdded() {
    // given a tbale with an index to which one more column has been added
    DBTable table = createTableWithColumns("tbl", 2);
    DBIndex index1 = new DBNonUniqueIndex("idx", true, table, "col1");
    DBIndex index2 = new DBNonUniqueIndex("idx", true, table, "col1", "col2");
    TableChange tableChange = new TableChange(table, null);
    // when performing a comparison
    new IndexComparator(config).compareObjects(index1, index2, tableChange);
    // then the result must be a ColumnsAddition
    System.out.println(tableChange);
View Full Code Here

Examples of org.databene.jdbacl.model.DBIndex

  @Test
  public void testIndexColumnRemoved() {
    // given a table with an index of which one column was removed
    DBTable table = createTableWithColumns("tbl", 2);
    DBIndex index1 = new DBNonUniqueIndex("idx", true, table, "col1", "col2");
    DBIndex index2 = new DBNonUniqueIndex("idx", true, table, "col1");
    TableChange tableChange = new TableChange(table, null);
    // when performing a comparison
    new IndexComparator(config).compareObjects(index1, index2, tableChange);
    // then the result must be a ColumnsRemoval
    System.out.println(tableChange);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.