private Set < String > getLinkTargetObjIDs ( FieldDefinition linkDef , DBObjectBatch dbObjBatch ) { Set < String > targObjIDs = new HashSet <> ( ) ; for ( DBObject dbObj : dbObjBatch . getObjects ( ) ) { List < String > objIDs = dbObj . getFieldValues ( linkDef . getName ( ) ) ; if ( objIDs != null ) { targObjIDs . addAll ( objIDs ) ; } Set < String > removeIDs = dbObj . getRemoveValues ( linkDef . getName ( ) ) ; if ( removeIDs != null ) { targObjIDs . addAll ( removeIDs ) ; } } return targObjIDs ; }
Target object IDs can be in the add or remove set .