Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

no save should be used on an aggregate, this commit fixes that

  • Loading branch information...
commit 424b06a18986a07b33e2dff0fd4c770bdf286de8 1 parent 415ba0c
Jettro Coenradie authored
2  src/groovy/nl/gridshore/sample/addressbook/command/handler/RegisterAddressCommandHandler.groovy
View
@@ -22,6 +22,6 @@ class RegisterAddressCommandHandler implements CommandHandler<RegisterAddressCom
Object handle(RegisterAddressCommand command, UnitOfWork unitOfWork) {
ContactAggregate contact = contactRepository.load(AggregateIdentifierFactory.fromString(command.identifier))
contact.registerAddress(command.addressType, new Address(command.city, command.streetNumber, command.zipCode))
-// contactRepository.save contact
+ return Void
}
}
2  src/groovy/nl/gridshore/sample/addressbook/command/handler/RemoveAddressCommandHandler.groovy
View
@@ -21,6 +21,6 @@ class RemoveAddressCommandHandler implements CommandHandler<RemoveAddressCommand
Object handle(RemoveAddressCommand command, UnitOfWork unitOfWork) {
ContactAggregate contact = contactRepository.load(AggregateIdentifierFactory.fromString(command.identifier))
contact.removeAddress(command.addressType)
- contactRepository.save contact
+ return Void
}
}
2  src/groovy/nl/gridshore/sample/addressbook/command/handler/RemoveContactCommandHandler.groovy
View
@@ -22,6 +22,6 @@ class RemoveContactCommandHandler implements CommandHandler<RemoveContactCommand
Object handle(RemoveContactCommand command, UnitOfWork unitOfWork) {
ContactAggregate contact = contactRepository.load(AggregateIdentifierFactory.fromString(command.identifier))
contact.delete()
- contactRepository.save contact
+ return Void
}
}
2  src/groovy/nl/gridshore/sample/addressbook/command/handler/UpdateContactCommandHandler.groovy
View
@@ -22,6 +22,6 @@ class UpdateContactCommandHandler implements CommandHandler<UpdateContactCommand
Object handle(UpdateContactCommand command, UnitOfWork unitOfWork) {
ContactAggregate contact = contactRepository.load(AggregateIdentifierFactory.fromString(command.identifier))
contact.changeName command.newNameForContact
- contactRepository.save contact
+ return Void
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.