public LotteryCreatedEventHandler() {
super(LotteryCreatedEvent.class);
}
public void handleMessage(LotteryCreatedEvent message) {
LotteryInfo info = message.getInfo();
simpleJdbcTemplate.update("insert into lottery(id, version, name, drawing_timestamp, prize_amount, ticket_price) values (?, ?, ?, ?, ?, ?)",
message.getAggregateRootId().getId(),
message.getAggregateRootId().getVersion(),
info.getName(),
info.getDrawingTimestamp(),
info.getPrizeAmount(),
info.getTicketPrice());
}