Hi
Is it possible to lookup and aggregate using attributes of a aggregate
root in axon framework.
The example showing in axon-addressbook-app-0.5-sources
Has the following code and it does not work and it throws
java.lang.RuntimeException: java.lang.IllegalArgumentException:
Invalid UUID string: steve
Contact contact =
repository.load(UUID.fromString(command.getContactNewName()));
found in
ContactCommandHandler
@CommandHandler
public void handle(ChangeContactNameCommand command) {
Assert.notNull(command.getContactId(), "ContactIdentifier may
not be null");
Assert.notNull(command.getContactNewName(), "Name may not be
null");
Contact contact =
repository.load(UUID.fromString(command.getContactNewName()));
contact.changeName(command.getContactNewName());
repository.save(contact);
}
test case written
// insert a contact
SampleCallBackHandler<CreateContactCommand,UUID>
sampleCallBackHandler=new
SampleCallBackHandler<CreateContactCommand,UUID>();
CreateContactCommand createContactCommand =new CreateContactCommand();
createContactCommand.setNewContactName("steve");
commandBus.dispatch(createContactCommand ,sampleCallBackHandler);
assertNotNull(sampleCallBackHandler.getResult());
//change the contact
SampleCallBackHandler<ChangeContactNameCommand,Object>
sampleCallBackHandler1=new
SampleCallBackHandler<ChangeContactNameCommand,Object>();
ChangeContactNameCommand changeContactNameCommand =new
ChangeContactNameCommand();
changeContactNameCommand.setContactId("1");
changeContactNameCommand.setContactNewName("steve");
commandBus.dispatch(changeContactNameCommand ,sampleCallBackHandler1);