class UserEventHandler {

    @EventHandler
    public void on(UserCreatedEvent event) {
        UserView userView = new UserView();

        userView.setIdentifier(event.getUserId().getIdentifier());
        userView.setName(event.getName());
        userView.setUsername(event.getUsername());
        userView.setPassword(event.getPassword());

        userRepository.save(userView);
    }

    @Autowired public  UserEventHandler(UserViewRepository userRepository);

}