Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<Photo> oldPhotoList = existingProperty.getPhotoList();
- List<Photo> newPhotoList = property.getPhotoList();
- if (oldPhotoList != null) {
- oldPhotoList.forEach(photo -> photo.setProperty(null));
- oldPhotoList.clear();
- }
- if (newPhotoList != null) {
- newPhotoList.forEach(photo -> photo.setProperty(existingProperty));
- }
- existingProperty.setPhotoList(newPhotoList);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement