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

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


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

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

               upgrade.addStep(drop);
            }
            else if (sElement.equals("ApplyIndexAspect"))
            {
               final ApplyIndexAspectStep apply = new ApplyIndexAspectStep();

               apply.setAspectName(XMLMetadataHelper.getNameAttr(stepElement, "name", XMLMetadataHelper.NAME_DOT));
               apply.setOverride(XMLUtil.getBooleanAttr(stepElement, "override", apply.isOverride()));

               XMLMetadataLoader.parsePatterns(XMLUtil.getStringAttr(stepElement, "pointcuts"),
                  new XMLMetadataLoader.PatternHandler()
                  {
                     public void handlePattern(String sPattern, boolean bInclusive)
                     {
                        apply.addPointcutPattern(sPattern, bInclusive);
                     }
                  });

               upgrade.addStep(apply);
            }
            else if (sElement.equals("RemoveIndexAspect"))
            {
               final RemoveIndexAspectStep remove = new RemoveIndexAspectStep();

               remove.setAspectName(XMLMetadataHelper.getNameAttr(stepElement, "name", XMLMetadataHelper.NAME_DOT));
               remove.setOverride(XMLUtil.getBooleanAttr(stepElement, "override", remove.isOverride()));

               XMLMetadataLoader.parsePatterns(XMLUtil.getStringAttr(stepElement, "pointcuts"),
                  new XMLMetadataLoader.PatternHandler()
                  {
                     public void handlePattern(String sPattern, boolean bInclusive)
                     {
                        remove.addPointcutPattern(sPattern, bInclusive);
                     }
                  });

               upgrade.addStep(remove);
            }
            else if (sElement.equals("CreateObject"))
            {
               CreateObjectStep create = new CreateObjectStep();
               SQLScript script = new SQLScript();

               create.setName(
                  XMLMetadataHelper.getNameAttr(stepElement, "name", XMLMetadataHelper.NAME_DOT));
               loadSQLScript(stepElement, script);
               create.setScript(script);
               upgrade.addStep(create);
            }
            else if (sElement.equals("DropObject"))
            {
               DropObjectStep drop = new DropObjectStep();
               SQLScript script = new SQLScript();

               drop.setName(
                  XMLMetadataHelper.getNameAttr(stepElement, "name", XMLMetadataHelper.NAME_DOT));
               loadSQLScript(stepElement, script);
               drop.setScript(script);
               upgrade.addStep(drop);
            }
            else if (sElement.equals("Exec"))
            {
               final ExecStep exec = new ExecStep();
View Full Code Here


      assertNotNull(table);
      assertEquals(1, table.getIndexCount());
      table.setType(Table.MANAGED); // comes in as Table.EXTERNAL from DB

      DropIndexStep step = new DropIndexStep();

      step.setName(table.getIndex(0).getName());
      schema = upgrade(step, schema, null);
      table = schema.getTable(m_singleIdxColTableStep.getName());
      assertNotNull(table);
      assertEquals(0, table.getIndexCount());
   }
View Full Code Here

TOP

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

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.