Created
April 16, 2015 11:03
-
-
Save CremboC/aa25c15152ee692ad67f to your computer and use it in GitHub Desktop.
StaleObjectException :D
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final Collection<Sample> allByBarcode = sampleService.byBarcode(groupRequest.getSamples(), currentUser); | |
if (!allByBarcode.isEmpty()) { | |
Group group = new Group(); | |
group.setName(groupRequest.getName()); | |
group.setSamples(allByBarcode); | |
group.setType(groupRequest.getType()); | |
group.setOwner(currentUser); | |
group = repository.save(group); | |
return Optional.ofNullable(group); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final Collection<Sample> allByBarcode = sampleService.byBarcode(groupRequest.getSamples(), currentUser); | |
if (!allByBarcode.isEmpty()) { | |
Group group = new Group(); | |
group.setName(groupRequest.getName()); | |
group.setSamples(new HashSet<>(allByBarcode)); | |
group.setType(groupRequest.getType()); | |
group.setOwner(currentUser); | |
group = repository.save(group); | |
return Optional.ofNullable(group); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment