title: Spring Boot @LastModifiedDate not updated
body: <p>I encounter a problem on my Update colum (log_updated_at). When i create an entity, it is created with a date, same as the creation date column.
  But when some fields are updated, the date don't change.
  I would like the date to change when something change.</p>
  <p>On my Main class i have those annotations :</p>
  <pre><code>@Slf4j
  @SpringBootApplication
  @EnableTransactionManagement
  @EnableJpaAuditing
  </code></pre>
  <p>My auditModel :</p>
  <pre><code>import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  import lombok.Data;
  import org.springframework.data.annotation.CreatedDate;
  import org.springframework.data.annotation.LastModifiedDate;
  import org.springframework.data.jpa.domain.support.AuditingEntityListener;
  import org.springframework.format.annotation.DateTimeFormat;
  import javax.persistence.*;
  import java.io.Serializable;
  import java.util.Date;
  
  @MappedSuperclass
  @Data
  @EntityListeners(AuditingEntityListener.class)
  @JsonIgnoreProperties(
          value = {&quot;logcreatedAt&quot;, &quot;logupdatedAt&quot;},
          allowGetters = true
  )
  public abstract class AuditModel implements Serializable {
      
      @Temporal(TemporalType.TIMESTAMP)
      @DateTimeFormat(pattern=&quot;yyyy-MM-dd HH:mm:ss&quot;)
      @Column(name = &quot;log_created_at&quot;, nullable = false, updatable = false)
      @CreatedDate
      private Date logCreatedAt = new Date();
      
      @Temporal(TemporalType.TIMESTAMP) 
      @DateTimeFormat(pattern=&quot;yyyy-MM-dd HH:mm:ss&quot;)
      @Column(name = &quot;log_updated_at&quot;, nullable = false)
      @LastModifiedDate
      private Date logUpdatedAt = new Date();
  }
  
  </code></pre>
  <p>And an update :</p>
  <pre><code>@Component
  @Slf4j
  public class SaveCheckConfig {
  
      @Autowired
      private CheckConfigRepository checkConfigRepository;
  
      @Autowired
      private CheckNamespaceAndService checkNamespaceAndService;
  
      @Autowired
      private SaveCheckConfig saveCheckConfig;
  
      @Autowired
      private MappingCheckConfigToDTO mappingCheckConfigToDTO;
  
      @Transactional(rollbackFor=Exception.class)
      public CheckConfig saveCheckConfigMethod(CheckConfigDTO checkConfigDTO) throws InternalServerErrorException {
          try {       
              Namespace namespace = checkNamespaceAndService.getNamespace(checkConfigDTO.getNamespace());
              Service service = checkNamespaceAndService.getServices(checkConfigDTO.getService());
              CheckConfig checkConfigexist = checkConfigRepository.findByNamespaceIdAndServiceIdAndTypeVerification(namespace.getId(), service.getId(), checkConfigDTO.getType_verification());
              if (checkConfigexist != null) { 
                  checkConfigexist.setDetails(checkConfigDTO.getDetails());
                  checkConfigexist.setStatus(checkConfigDTO.getStatus());
                  checkConfigexist.setStatusComplementaire(checkConfigDTO.getStatus_complementaire());
                  checkConfigexist.setActionBy(checkConfigDTO.getAction_by());
                  checkConfigRepository.save(checkConfigexist);   
                  log.info(&quot;[CheckConfig] Update réalisé pour -&gt; Namespace : &quot; + checkConfigDTO.getNamespace() + &quot; -&gt; Service : &quot; + checkConfigDTO.getService() + &quot; -&gt; TypeVerification : &quot; + checkConfigDTO.getType_verification()); 
                  return checkConfigexist;
              }
  ...
  ...
  }
  </code></pre>
  <p>After the save, the update date is not changed :
  &quot;logCreatedAt&quot;: &quot;2020-11-03T21:00:23.000+01:00&quot;,
  &quot;logUpdatedAt&quot;: &quot;2020-11-03T21:00:23.000+01:00&quot;,</p>
  <p>Thanks for help</p>
  <p>[EDIT] This helped me !
  <a href="https://stackoverflow.com/questions/61525071/spring-boot-tables-in-database-not-updated-when-entity-field-is-modified">Spring boot tables in database not updated when entity field is modified</a></p>
  <p>When no one column is set to null, the date is updated, but i would like it works even with null value</p>