class CompanyEventHandler {

    @EventHandler
    public void on(CompanyCreatedEvent event) {
        CompanyView companyView = new CompanyView();

        companyView.setIdentifier(event.getCompanyId().getIdentifier());
        companyView.setValue(event.getCompanyValue());
        companyView.setAmountOfShares(event.getAmountOfShares());
        companyView.setTradeStarted(true);
        companyView.setName(event.getCompanyName());

        companyRepository.save(companyView);
    }

    @Autowired public  CompanyEventHandler(CompanyViewRepository companyRepository);

}