title: Spring Boot @RepositoryEventHandler not invoked
body: <p>I've got a <code>@RepositoryEventHandler</code> set up and it is not being invoked for some unknown reason.</p>
  
  <pre><code>@Component
  @RepositoryEventHandler(User.class)
  public class UserEventHandler {
  
      @Autowired
      private PasswordCrypto passwordCrypto;
  
      @HandleBeforeSave
      public void handleUserSave(User user) {
          if (user.getPassword() != null &amp;&amp; !"".equals(user.getPassword())) {
              user.setPassword(passwordCrypto.encrypt(user.getPassword()));
          }
      }
  
      @HandleBeforeCreate
      public void handleUserCreate(User user) {
          user.setPassword(passwordCrypto.encrypt(user.getPassword()));
      }
  }
  </code></pre>
  
  <p>The Repository:</p>
  
  <pre><code>public interface UserRepository extends CrudRepository&lt;User, Long&gt; {
      Optional&lt;User&gt; findOneByUsername(String username);
  }
  </code></pre>
  
  <p>And my main class:</p>
  
  <pre><code>@SpringBootApplication
  @EntityScan("de.ihrig.feuerwehr.hydranet.model")
  @EnableJpaRepositories
  @ComponentScan({
      "somepath",
      "somepath including the UserEventHandler"
  })
  public class ServerApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(ServerApplication.class, args);
      }
  }
  </code></pre>
  
  <p>Thanks for your help in advance, I just cannot find the error.</p>