{
nextRel.setSecondPrevRel( rel.getId() );
}
else
{
throw new InvalidRecordException( firstNode + " dont match "
+ nextRel );
}
getRelationshipStore().updateRecord( nextRel );
}
if ( secondNode.getNextRel() != Record.NO_NEXT_RELATIONSHIP.intValue() )
{
RelationshipRecord nextRel = getRelationshipStore().getRecord(
secondNode.getNextRel() );
if ( nextRel.getFirstNode() == secondNode.getId() )
{
nextRel.setFirstPrevRel( rel.getId() );
}
else if ( nextRel.getSecondNode() == secondNode.getId() )
{
nextRel.setSecondPrevRel( rel.getId() );
}
else
{
throw new InvalidRecordException( secondNode + " dont match "
+ nextRel );
}
getRelationshipStore().updateRecord( nextRel );
}
firstNode.setNextRel( rel.getId() );