title: How update table automatically with @DynamicUpdate and @Transactional
body: <p>I would like to update a column entry automatically when the application start. To do that, I've a simple model with @DynamicUpdate anotation :</p>
  <pre><code>@Entity
  @DynamicUpdate
  @EqualsAndHashCode
  public class User implements Serializable {
  
  int id;
  String firstName;
  String SecondName;
  String Maths;
  
  }
  </code></pre>
  <p>to update Maths, I've created 2 methods in its service with @Transactional anotation:</p>
  <pre><code>    @EventListener(ApplicationReadyEvent.class)
      @Transactional
      public void updateMaths() {
          Integer i = 580168;
          calculateMathsById(i);
  
      }
  
  public void calculateMathsById(int id){
          User user = userRepository.getById(id);
          int number = calculateNumber(user);
          model.setMaths(user);
          modelRepository.update(user);
      }
  </code></pre>
  <p>and finally, here's the simple repository method with @Modifying anotation :</p>
  <pre><code>    @Modifying
      @Query(&quot;update User  set maths = (:maths) where id = (:id)&quot;)
      public void updateUser(@Param(&quot;maths&quot;) Integer maths, @Param(&quot;id&quot;) Integer id);
  </code></pre>
  <p>Everything seems to be correct, the application start but nothing appends. What did I do wrong?</p>