code: @Override
     protected int addReference(PropertyData data) throws SQLException, IOException, InvalidItemStateException,
        RepositoryException
     {
  
        List<ValueData> values = data.getValues();
        int added = 0;
        for (int i = 0; i < values.size(); i++)
        {
           ValueData vdata = values.get(i);
           String refNodeIdentifier;
           try
           {
              refNodeIdentifier = ValueDataUtil.getString(vdata);
           }
           catch (RepositoryException e)
           {
              throw new IOException(e.getMessage(), e);
           }
  
           added += addReference(getInternalId(data.getIdentifier()), i, getInternalId(refNodeIdentifier));
        }
        return added;
     }
docs: {@inheritDoc}