All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ulting.orcas.orcas-domainextension-extenions.8.6.4.source-code.ReverseExtension21FkGenIdx Maven / Gradle / Ivy

Go to download

orcas custom extensions (contains only support classes and an empty-extension). If custom-extensions are provided, there will be a custom artifact.

The newest version!
package de.opitzconsulting.orcas.extensions;

import java.util.ArrayList;

import de.opitzconsulting.orcas.extensions.OrcasBaseExtensionWithParameter;
import de.opitzconsulting.orcasDsl.Index;
import de.opitzconsulting.orcasDsl.IndexOrUniqueKey;
import de.opitzconsulting.orcasDsl.Model;
import de.opitzconsulting.orcasDsl.ModelElement;
import de.opitzconsulting.orcasDsl.Table;

public class ReverseExtension21FkGenIdx extends OrcasBaseExtensionWithParameter implements OrcasReverseExtension
{
  @Override
  public Model transformModel( Model pModel )
  {
    for( ModelElement lModelElement : new ArrayList( pModel.getModel_elements() ) )
    {
      if( lModelElement instanceof Table )
      {
        Table lTable = (Table)lModelElement;
        for( IndexOrUniqueKey lIndexOrUniqueKey : new ArrayList( lTable.getInd_uks() ) )
        {
          if( lIndexOrUniqueKey instanceof Index )
          {
            Index lIndex = (Index)lIndexOrUniqueKey;

            if( lIndex.getConsName().endsWith( "_GEN_IX" ) )
            {
              lTable.getInd_uks().remove( lIndex );
            }
          }
        }
      }
    }

    return pModel;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy