}
}
void relRemoveProperty( long relId, long propertyId )
{
RelationshipRecord relRecord = getRelationshipRecord( relId );
if ( relRecord == null )
{
relRecord = getRelationshipStore().getRecord( relId );
}
if ( !relRecord.inUse() )
{
throw new IllegalStateException( "Property remove on relationship[" +
relId + "] illegal since it has been deleted." );
}
PropertyRecord propRecord = getPropertyRecord( propertyId );
if ( propRecord == null )
{
propRecord = getPropertyStore().getRecord( propertyId );
addPropertyRecord( propRecord );
}
if ( !propRecord.inUse() )
{
throw new IllegalStateException( "Unable to delete property[" +
propertyId + "] since it is already deleted." );
}
propRecord.setRelId( relId );
if ( propRecord.isLight() )
{
getPropertyStore().makeHeavy( propRecord );
}
propRecord.setInUse( false );
// TODO: update count on property index record
for ( DynamicRecord valueRecord : propRecord.getValueRecords() )
{
if ( valueRecord.inUse() )
{
valueRecord.setInUse( false, propRecord.getType().intValue() );
}
}
long prevProp = propRecord.getPrevProp();
long nextProp = propRecord.getNextProp();
if ( relRecord.getNextProp() == propertyId )
{
relRecord.setNextProp( nextProp );
// re-adding not a problem
addRelationshipRecord( relRecord );
}
if ( prevProp != Record.NO_PREVIOUS_PROPERTY.intValue() )
{