while (i < j)
{
Constraint localConstraint = paramTable.constraintList[i];
if ((localConstraint.getType() == 1) && (localConstraint.getRef() != null))
{
RowIterator localRowIterator = localConstraint.findFkRef(paramSession, paramRow.getData(), paramBoolean);
if (localRowIterator.hasNext())
try
{
Object localObject1;
if (localConstraint.core.deleteAction == 3)
{
if (localConstraint.core.mainTable == localConstraint.core.refTable)
{
localObject1 = localRowIterator.next();
if (paramRow.equals(localObject1))
{
localRowIterator.release();
break label650;
}
}
throw Trace.error(8, 100, new Object[] { localConstraint.core.fkName.name, localConstraint.core.refTable.getName().name });
}
else
{
localObject1 = localConstraint.getRef();
int k = ((Table)localObject1).getNextConstraintIndex(0, 1) != -1 ? 1 : 0;
if ((!paramBoolean) && (k == 0))
{
localRowIterator.release();
}
else
{
Index localIndex = localConstraint.getRefIndex();
int[] arrayOfInt1 = localConstraint.getMainColumns();
int[] arrayOfInt2 = localConstraint.getRefColumns();
Object[] arrayOfObject1 = paramRow.getData();
int m = (localConstraint.getDeleteAction() == 2) || (localConstraint.getDeleteAction() == 4) ? 1 : 0;
HashMappedList localHashMappedList = null;
if (m != 0)
{
localHashMappedList = (HashMappedList)paramHashMappedList.get(localObject1);
if (localHashMappedList == null)
{
localHashMappedList = new HashMappedList();
paramHashMappedList.add(localObject1, localHashMappedList);
}
}
while (true)
{
Row localRow = localRowIterator.next();
if ((localRow == null) || (localRow.isCascadeDeleted()) || (localIndex.compareRowNonUnique(paramSession, arrayOfObject1, arrayOfInt1, localRow.getData()) != 0))
break;
if (m != 0)
{
Object[] arrayOfObject2 = ((Table)localObject1).getEmptyRowData();
System.arraycopy(localRow.getData(), 0, arrayOfObject2, 0, arrayOfObject2.length);
if (localConstraint.getDeleteAction() == 2)
for (n = 0; n < arrayOfInt2.length; n++)
arrayOfObject2[arrayOfInt2[n]] = null;
for (int n = 0; n < arrayOfInt2.length; n++)
{
Column localColumn = ((Table)localObject1).getColumn(arrayOfInt2[n]);
arrayOfObject2[arrayOfInt2[n]] = localColumn.getDefaultValue(paramSession);
}
if ((k != 0) && (paramHashSet.add(localConstraint)))
{
checkCascadeUpdate(paramSession, (Table)localObject1, null, localRow, arrayOfObject2, arrayOfInt2, null, paramHashSet);
paramHashSet.remove(localConstraint);
}
if ((paramBoolean) && ((localObject1 != paramTable) || (!localRow.equals(paramRow))))
mergeUpdate(localHashMappedList, localRow, arrayOfObject2, arrayOfInt2);
}
else if (k != 0)
{
if (localObject1 != paramTable)
{
if (paramHashSet.add(localConstraint))
{
checkCascadeDelete(paramSession, (Table)localObject1, paramHashMappedList, localRow, paramBoolean, paramHashSet);
paramHashSet.remove(localConstraint);
}
}
else if (localRow != paramRow)
checkCascadeDelete(paramSession, (Table)localObject1, paramHashMappedList, localRow, paramBoolean, paramHashSet);
}
if ((!paramBoolean) || (m != 0) || (localRow.isCascadeDeleted()))
continue;
((Table)localObject1).deleteNoRefCheck(paramSession, localRow);
}
}
}
}
finally
{
localRowIterator.release();
}
}
label650: i++;
}
}