@PostMapping
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void create(@RequestBody @Valid CreateTaskRequest request) {
UUID id = UUID.randomUUID();
commandGateway.send(new CreateTaskCommand(id, request.getTitle()));
}
@Aggregatepublic class Task {
private static final long serialVersionUID = -5977984483620451665L;
private static Logger LOGGER = LogManager.getLogger(ApiController.class);
@AggregateIdentifier
private UUID id;
@CommandHandler
public Task(CreateTaskCommand command) {
apply(new TaskCreatedEvent(command.getId(), command.getTitle(), command.getCreatedAt()));
}
@EventSourcingHandler
void on(TaskCreatedEvent event) {
this.id = event.getId();
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
}
21:51:22.591 [http-nio-8080-exec-1] WARN org.hibernate.engine.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: 42P01
21:51:22.591 [http-nio-8080-exec-1] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - ERROR: relation "hibernate_sequence" does not exist
Pozice: 17
21:51:22.597 [http-nio-8080-exec-1] WARN org.axonframework.commandhandling.gateway.DefaultCommandGateway - Command 'sandbox.CreateTaskCommand' resulted in org.axonframework.eventsourcing.eventstore.EventStoreException(An event for aggregate [a335b9ca-fe8d-49e0-aa90-4fa76ddbb450] at sequence [0] could not be persisted)--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.