Advertisement
Guest User

Untitled

a guest
May 24th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. List<Photo> oldPhotoList = existingProperty.getPhotoList();
  2. List<Photo> newPhotoList = property.getPhotoList();
  3.  
  4. if (oldPhotoList != null) {
  5. oldPhotoList.forEach(photo -> photo.setProperty(null));
  6. oldPhotoList.clear();
  7. }
  8. if (newPhotoList != null) {
  9. newPhotoList.forEach(photo -> photo.setProperty(existingProperty));
  10. }
  11. existingProperty.setPhotoList(newPhotoList);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement