@@ -0,0 +1,1313 @@
+package br.holandajunior.workaday.projections;%0A%0Aimport br.holandajunior.workaday.events.point.PointCreated;%0Aimport br.holandajunior.workaday.events.user.UserCreated;%0Aimport br.holandajunior.workaday.model.Point;%0Aimport br.holandajunior.workaday.model.User;%0Aimport br.holandajunior.workaday.repository.UserRepository;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.jms.annotation.JmsListener;%0Aimport org.springframework.stereotype.Service;%0A%0A/**%0A * Created by holandajunior on 30/04/17.%0A */%0A%0A@Service%0Apublic class UserProjections %7B%0A%0A    @Autowired%0A    private UserRepository userRepo;%0A%0A    @JmsListener( destination = UserCreated.DESTINATION)%0A    public void onUserCreated( UserCreated userCreated ) %7B%0A%0A        User user = new User();%0A        user.setName( userCreated.getName() );%0A        user.setEmail( userCreated.getEmail() );%0A%0A        userRepo.save( user );%0A    %7D%0A%0A    @JmsListener( destination = PointCreated.DESTINATION)%0A    public void onPointCreated(PointCreated pointCreated) %7B%0A%0A        User user = userRepo.findOne( pointCreated.getUserId() );%0A%0A        Point point = new Point();%0A        point.setEntry( pointCreated.getEntry() );%0A        point.setExit( pointCreated.getExit() );%0A%0A        user.getPoints().add( point );%0A%0A        userRepo.save( user );%0A    %7D%0A%0A%7D%0A

Add event listeners to update projections