title: @CreatedDate set to null on update (spring-data-jdbc)
body: <p>I am trying to use <code>@CreatedDate</code> in combination with spring-data-jdbc and a PostgreSQL database to track when a table entry was first created. This works when a new row is inserted (it correctly sets it as the current date), but when updating the entry, I get exceptions because it is getting set to null which is not allowed by my configuration.</p>
  <p>This is my entity (left out other non-relevant fields):</p>
  <pre><code>@Table(&quot;my_entity&quot;)
  public class MyEntity {
  
      @Id
      private final Long id;
  
      @Column(&quot;created_at&quot;)
      @CreatedDate
      private Instant createdAt;
  
      public MyEntity (Long id) {
          this.id = id;
      }
  
      public Long getId() {
          return id;
      }
  
      public Instant getCreatedAt() {
          return createdAt;
      }
  
      public void setCreatedAt(Instant createdAt) {
          this.createdAt = createdAt;
      }
  }
  </code></pre>
  <p>This is my repository:</p>
  <pre><code>public interface MyRepository extends CrudRepository&lt;MyEntity, Long&gt; {}
  </code></pre>
  <p>And this is the relevant configuration:</p>
  <pre><code>@Configuration
  @EnableJdbcRepositories(&quot;com.example&quot;)
  @EnableJdbcAuditing
  public class JdbcConfig extends AbstractJdbcConfiguration {
  }
  </code></pre>
  <p>Using the <code>repository.saveAll()</code> method, the <code>createdAt</code> field is correctly set the first time. When updating an existing entity with the same method, it is getting set to null when I would expect the field to get skipped.</p>
  <p>I already tried the following:</p>
  <ul>
  <li>Removing public getters and setters as suggested for spring-data-rest (see <a href="https://github.com/spring-projects/spring-data-rest/issues/1565" rel="nofollow noreferrer">here</a>) - didn't change anything</li>
  <li>Setting <code>@Column(name=&quot;created_at&quot;, updatable=&quot;false&quot;)</code> as suggested for JPA (see <a href="https://stackoverflow.com/a/47643242/9926180">here</a>) - this field is not available for the annotation I'm using (<code>org.springframework.data.relational.core.mapping.Column</code>)</li>
  </ul>
  <p>The two solutions I've found so far is to either use a database trigger or manually retrieve the entity from the database prior to updating it and setting the created date manually (also mentioned <a href="https://stackoverflow.com/a/72313922/9926180">here</a>). Are there any other options or did I configure something wrong? Is this expected behaviour?</p>