Package nexj.core.meta.persistence.sql

Examples of nexj.core.meta.persistence.sql.RelationalSchema


    * Appends SQL for renaming an index to the SQL appender and upgrades the metadata.
    * @param step The rename index step.
    */
   protected void renameIndex(RenameIndexStep step)
   {
      RelationalSchema schema = m_state.getSchema();
      Index oldIndex = schema.getIndex(step.getOldName()).getTable().cloneTemporary()
                          .getIndex(step.getOldName());

      step.apply(m_state);

      renameIndex(step.getIndex(), oldIndex);
View Full Code Here


    * Appends SQL for dropping an index to the SQL appender and upgrades the metadata.
    * @param step The drop index step.
    */
   protected void dropIndex(DropIndexStep step)
   {
      RelationalSchema schema = m_state.getSchema();
      Index index = schema.getIndex(step.getName());

      if (!index.isAspect())
      {
         if (index.getTable().isAspect())
         {
View Full Code Here

   /**
    * @see nexj.core.meta.persistence.sql.upgrade.RelationalSchemaUpgradeStep#apply(nexj.core.meta.persistence.sql.upgrade.RelationalSchemaUpgradeState)
    */
   public void apply(RelationalSchemaUpgradeState state)
   {
      RelationalSchema schema = state.getSchema();
      Table table = schema.getTable(m_sTableName);

      m_column = table.getColumn(m_sName);
      table.removeColumn(m_column);

      if (table.isAspect())
      {
         for (Iterator itr = schema.getTableIterator(); itr.hasNext();)
         {
            Table pointcut = (Table)itr.next();

            if (pointcut.hasAspect(table))
            {
View Full Code Here

    * Appends SQL for removing an index aspect to the SQL appender and upgrades the metadata.
    * @param step The remove index aspect step.
    */
   protected void removeIndexAspect(RemoveIndexAspectStep step)
   {
      RelationalSchema schema = m_state.getSchema();
      Index aspect = schema.getIndex(step.getAspectName());
      List pointcutList = new ArrayList();

      for (Iterator itr = step.getPointcutIterator(schema.getIndexIterator()); itr.hasNext();)
      {
         Index index = (Index)itr.next();

         if (index.hasAspect(aspect))
         {
View Full Code Here

   /**
    * @see nexj.core.meta.persistence.sql.upgrade.RelationalSchemaUpgradeStep#apply(nexj.core.meta.persistence.sql.upgrade.RelationalSchemaUpgradeState)
    */
   public void apply(RelationalSchemaUpgradeState state)
   {
      RelationalSchema schema = state.getSchema();

      m_index = schema.getIndex(m_sAspectName);

      if (m_index.getType() != Index.ASPECT)
      {
         throw new MetadataException("err.meta.indexAspectUpgradeType", new Object[]{m_sAspectName});
      }
View Full Code Here

    */
   public void undo(RelationalSchemaUpgradeState state)
   {
      if (!state.containsIndex(m_sAspectName))
      {
         RelationalSchema schema = state.getSchema();

         m_index = schema.findIndex(m_sAspectName);

         if (m_index != null)
         {
            if (m_index.getType() != Index.ASPECT)
            {
View Full Code Here

   /**
    * @see nexj.core.meta.persistence.sql.upgrade.RelationalSchemaUpgradeStep#apply(nexj.core.meta.persistence.sql.upgrade.RelationalSchemaUpgradeState)
    */
   public void apply(RelationalSchemaUpgradeState state)
   {
      RelationalSchema schema = state.getSchema();
      Table table = schema.getTable(m_sTableName);

      m_column = table.getColumn(m_outline.getName());
      m_outline.copyTo(m_column);

      if (table.isAspect())
      {
         for (Iterator itr = schema.getTableIterator(); itr.hasNext();)
         {
            Table pointcut = (Table)itr.next();

            if (pointcut.hasAspect(table))
            {
View Full Code Here

   /**
    * @see nexj.core.meta.persistence.sql.upgrade.RelationalSchemaUpgradeStep#apply(nexj.core.meta.persistence.sql.upgrade.RelationalSchemaUpgradeState)
    */
   public void apply(RelationalSchemaUpgradeState state)
   {
      RelationalSchema schema = state.getSchema();

      m_table = schema.getTable(m_sAspectName);

      if (m_table.getType() != Table.ASPECT)
      {
         throw new MetadataException("err.meta.tableAspectUpgradeType", new Object[]{m_sAspectName});
      }
View Full Code Here

    */
   public void undo(RelationalSchemaUpgradeState state)
   {
      if (!state.containsTable(m_sAspectName))
      {
         RelationalSchema schema = state.getSchema();

         m_table = schema.getTable(m_sAspectName);

         if (m_table.getType() != Table.ASPECT)
         {
            throw new MetadataException("err.meta.tableAspectUpgradeType", new Object[]{m_sAspectName});
         }
View Full Code Here

      if (dataSource instanceof RelationalDatabase)
      {
         RelationalDatabase database = (RelationalDatabase)dataSource;
         SQLAdapter adapter = (SQLAdapter)database.getComponent().getInstance(m_context);
         SQLSchemaManager manager = adapter.createSchemaManager(database);
         RelationalSchema schema = (RelationalSchema)database.getSchema();
         String sOrigFragment = m_context.getFragmentName();
         Connection connection = null;

         try
         {
View Full Code Here

TOP

Related Classes of nexj.core.meta.persistence.sql.RelationalSchema

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.