private void preserveParentLink(String brokenTableName,String brokenColumnName,String brokenDefaultValue,ArrayList<String> brokenCompareColumns,String hintTableName,String hintColumnName,ArrayList<String> hintCompareColumns){
  String vendorName=m_target.getVendor();
  String catalogName=m_target.getCatalog();
  String schemaName=m_target.getSchema();
  if (m_source.isObjectExists(brokenTableName,m_source.getTables())) {
    boolean columnToPreserveLinkExists=false;
    DBObject tableToPreserveLink=m_source.getObjectByName(brokenTableName,m_source.getTables());
    HashMap<Integer,DBObjectDefinition> columns=tableToPreserveLink.getContents();
    Vector<Integer> vc=new Vector<Integer>(columns.keySet());
    for (Iterator<Integer> ic=vc.iterator(); ic.hasNext(); ) {
      int kc=ic.next();
      DBObject_Table_Column columnDetail=(DBObject_Table_Column)columns.get(kc);
      String columnName=columnDetail.getName();
      if (columnName.equalsIgnoreCase(brokenColumnName))       columnToPreserveLinkExists=true;
    }
    if (columnToPreserveLinkExists) {
      s_logger.log(Level.FINE,"preserveParentLinkDetail",new Object[]{m_objectType,brokenTableName,m_direction});
      String sqlCommand=s_dbEngine.sqlAction_preserveParentLinks(vendorName,catalogName,schemaName,brokenTableName,brokenColumnName,brokenDefaultValue,brokenCompareColumns,hintTableName,hintColumnName,hintCompareColumns);
      if (sqlCommand != null) {
        Savepoint sp=m_target.setSavepoint("preserveParentLinks");
        Statement stmt=m_target.setStatement();
        Integer sqlResult=m_target.executeUpdate(stmt,sqlCommand,false,false);
        if (sqlResult != null) {
          logUpdateDetail(sqlResult,null);
          m_counterUpd=new Integer(m_counterUpd.intValue() + 1);
        }
        m_target.releaseStatement(stmt);
        m_totalUpd=new Integer(m_totalUpd.intValue() + 1);
        m_target.releaseSavepoint(sp);
      }
    }
  }
}

private void preserveParentLink ( String brokenTableName , String brokenColumnName , String brokenDefaultValue , ArrayList < String > brokenCompareColumns , String hintTableName , String hintColumnName , ArrayList < String > hintCompareColumns ) { String vendorName = m_target . getVendor ( ) ; String catalogName = m_target . getCatalog ( ) ; String schemaName = m_target . getSchema ( ) ; if ( m_source . isObjectExists ( brokenTableName , m_source . getTables ( ) ) ) { boolean columnToPreserveLinkExists = false ; DBObject tableToPreserveLink = m_source . getObjectByName ( brokenTableName , m_source . getTables ( ) ) ; HashMap < Integer , DBObjectDefinition > columns = tableToPreserveLink . getContents ( ) ; Vector < Integer > vc = new Vector < Integer > ( columns . keySet ( ) ) ; for ( Iterator < Integer > ic = vc . iterator ( ) ; ic . hasNext ( ) ; ) { int kc = ic . next ( ) ; DBObject_Table_Column columnDetail = ( DBObject_Table_Column ) columns . get ( kc ) ; String columnName = columnDetail . getName ( ) ; if ( columnName . equalsIgnoreCase ( brokenColumnName ) ) columnToPreserveLinkExists = true ; } if ( columnToPreserveLinkExists ) { s_logger . log ( Level . FINE , "preserveParentLinkDetail" , new Object [ ] { m_objectType , brokenTableName , m_direction } ) ; String sqlCommand = s_dbEngine . sqlAction_preserveParentLinks ( vendorName , catalogName , schemaName , brokenTableName , brokenColumnName , brokenDefaultValue , brokenCompareColumns , hintTableName , hintColumnName , hintCompareColumns ) ; if ( sqlCommand != null ) { Savepoint sp = m_target . setSavepoint ( "preserveParentLinks" ) ; Statement stmt = m_target . setStatement ( ) ; Integer sqlResult = m_target . executeUpdate ( stmt , sqlCommand , false , false ) ; if ( sqlResult != null ) { logUpdateDetail ( sqlResult , null ) ; m_counterUpd = new Integer ( m_counterUpd . intValue ( ) + 1 ) ; } m_target . releaseStatement ( stmt ) ; m_totalUpd = new Integer ( m_totalUpd . intValue ( ) + 1 ) ; m_target . releaseSavepoint ( sp ) ; } } } }
preserve or re - create link to parent from a given child table
