Package nexj.core.meta.persistence.sql.upgrade

Examples of nexj.core.meta.persistence.sql.upgrade.RenameColumnStep


               upgrade.addStep(alter);
            }
            else if (sElement.equals("RenameColumn"))
            {
               RenameColumnStep ren = new RenameColumnStep();

               ren.setTableName(XMLMetadataHelper.getNameAttr(stepElement, "table", XMLMetadataHelper.NAME_DOT));
               ren.setOldName(XMLMetadataHelper.getNameAttr(stepElement, "name", XMLMetadataHelper.NAME_ID));
               ren.setNewName(XMLMetadataHelper.getNameAttr(stepElement, "to", XMLMetadataHelper.NAME_ID));

               upgrade.addStep(ren);
            }
            else if (sElement.equals("DropColumn"))
            {
               DropColumnStep drop = new DropColumnStep();

               drop.setTableName(XMLMetadataHelper.getNameAttr(stepElement, "table", XMLMetadataHelper.NAME_DOT));
               drop.setName(XMLMetadataHelper.getNameAttr(stepElement, "name", XMLMetadataHelper.NAME_ID));

               upgrade.addStep(drop);
            }
            else if (sElement.equals("CreateIndex"))
            {
               CreateIndexStep create = new CreateIndexStep();

               create.setTableName(XMLMetadataHelper.getNameAttr(stepElement, "table", XMLMetadataHelper.NAME_DOT));

               IndexOutline outline = new IndexOutline();

               loadIndexOutline(stepElement, outline);

               create.setOutline(outline);

               upgrade.addStep(create);
            }
            else if (sElement.equals("RenameIndex"))
            {
               RenameIndexStep ren = new RenameIndexStep();

               ren.setOldName(XMLMetadataHelper.getNameAttr(stepElement, "name", XMLMetadataHelper.NAME_DOT));
               ren.setNewName(XMLMetadataHelper.getNameAttr(stepElement, "to", XMLMetadataHelper.NAME_DOT));

               upgrade.addStep(ren);
            }
            else if (sElement.equals("DropIndex"))
            {
View Full Code Here


      statement.setSQL("insert into " + table.getQuotedName() + " values (1)");
      script.addStatement(statement);
      populate.getScriptHolder().addScript(script);
      upgrade(populate, schema, null);

      RenameColumnStep step = new RenameColumnStep();

      step.setTableName(table.getName());
      step.setOldName("id");
      step.setNewName("id1");
      schema = upgrade(step, schema, null);
      table = schema.getTable(m_singleColTableStep.getName());
      assertNotNull(table);
      assertEquals(1, table.getColumnCount());
      assertEquals("id1", table.getColumn(0).getName());
View Full Code Here

TOP

Related Classes of nexj.core.meta.persistence.sql.upgrade.RenameColumnStep

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.