title: created_by is always set to null in the database and Version does not work properly
body: <p>I am trying to implement one entity to see how Auditing works in spring. I have tow issues here: </p>
  
  <p>First issue is that "created_by" field is always set to null in the database, although I have created a bean of AuditAware and set it to myself.</p>
  
  <p>Second issue is that whenever I want to insert something into the country table, it forces me to provide the version number. It is not the behaviour I want as I expect version gets picked up by the spring itself</p>
  
  <p>I appreciate if someone could help me to tackle these two issues.</p>
  
  <p>AbstractMethodEntity is as follow:</p>
  
  <pre><code>package com.xx.xxx.hotel;
  
  import org.springframework.data.annotation.CreatedBy;
  import org.springframework.data.annotation.CreatedDate;
  import org.springframework.data.annotation.LastModifiedBy;
  import org.springframework.data.annotation.LastModifiedDate;
  import org.springframework.data.jpa.domain.support.AuditingEntityListener;
  
  import javax.persistence.*;
  import java.time.LocalDateTime;
  
  @MappedSuperclass
  @EntityListeners({ AuditingEntityListener.class })
  public abstract class AbstractModelEntity&lt;U&gt; {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;
  
    @Column(name = "created_by")
    @CreatedBy
    private U CreatedBy;
  
    @Column(name = "create_date")
    @CreatedDate
    private LocalDateTime createdDate;
  
    @Version
    private long version;
  
    @Column(name = "modified_by")
    @LastModifiedBy
    private U lastModifiedBy;
  
    @Column(name = "modified_date")
    @LastModifiedDate
    private LocalDateTime lastModifiedDate;
  
    public long getId() {
      return id;
    }
  
    public void setId(long id) {
      this.id = id;
    }
  
    public long getVersion() {
      return version;
    }
  
    public void setVersion(long version) {
      this.version = version;
    }
  
    public U getCreatedBy() {
      return CreatedBy;
    }
  
    public void setCreatedBy(U createdBy) {
      CreatedBy = createdBy;
    }
  
    public LocalDateTime getCreatedDate() {
      return createdDate;
    }
  
    public void setCreatedDate(LocalDateTime createdDate) {
      this.createdDate = createdDate;
    }
  
    public U getLastModifiedBy() {
      return lastModifiedBy;
    }
  
    public void setLastModifiedBy(U lastModifiedBy) {
      this.lastModifiedBy = lastModifiedBy;
    }
  
    public LocalDateTime getLastModifiedDate() {
      return lastModifiedDate;
    }
  
    public void setLastModifiedDate(LocalDateTime lastModifiedDate) {
      this.lastModifiedDate = lastModifiedDate;
    }
  }
  </code></pre>
  
  <p>The Country entity: </p>
  
  <pre><code>package com.xx.xxx.hotel.service.country;
  
  import com.miraftabi.hossein.hotel.AbstractModelEntity;
  import org.hibernate.envers.AuditOverride;
  import org.hibernate.envers.Audited;
  
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.Table;
  
  @Entity
  @Audited
  @AuditOverride(forClass = AbstractModelEntity.class, isAudited = true)
  @Table(name = "country")
  public class CountryEntity extends AbstractModelEntity&lt;String&gt; {
  
    @Column(name = "name", nullable = false)
    private String name;
  
    public String getName() {
      return name;
    }
  
    public void setName(String name) {
      this.name = name;
    }
  }
  </code></pre>
  
  <p>AuditAwareImpl file:</p>
  
  <pre><code>package com.xx.xxx.hotel.service;
  
  import org.springframework.data.domain.AuditorAware;
  
  import java.util.Optional;
  
  public class AuditorAwareImpl implements AuditorAware&lt;String&gt; {
    @Override
    public Optional&lt;String&gt; getCurrentAuditor() {
      return Optional.of("Hossein");
    }
  }
  </code></pre>
  
  <p>AuditConfiguraiton file:</p>
  
  <pre><code>package com.xx.xxx.hotel.config;
  
  import com.xx.xxx.hotel.service.AuditorAwareImpl;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.data.domain.AuditorAware;
  import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
  
  @Configuration
  @EnableJpaAuditing(auditorAwareRef = "auditorAware")
  public class AuditConfiguration {
  
    @Bean
    public AuditorAware&lt;String&gt; auditorAware() {
      return new AuditorAwareImpl();
    }
  }
  </code></pre>
  
  <p>RepositoryConfiguration file:</p>
  
  <pre><code>package com.xx.xxx.hotel.config;
  
  import org.springframework.context.annotation.Configuration;
  import org.springframework.data.envers.repository.support.EnversRevisionRepositoryFactoryBean;
  import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
  
  @Configuration
  @EnableJpaRepositories(repositoryFactoryBeanClass = EnversRevisionRepositoryFactoryBean.class)
  public class RepositoryConfiguration {
  }
  </code></pre>
  
  <p>CountryRevisionRepository file:</p>
  
  <pre><code>package com.xx.xxx.hotel.service.country;
  
  import org.springframework.data.repository.history.RevisionRepository;
  import org.springframework.stereotype.Repository;
  
  @Repository
  public interface CountryRevisionRepository  extends RevisionRepository&lt;CountryEntity, Long, Integer&gt; {
  }
  </code></pre>
  
  <p>Application.properties:</p>
  
  <pre><code>spring.jpa.hibernate.ddl-auto=update
  spring.datasource.url=jdbc:mysql://localhost:3306/hotel
  spring.datasource.username=${DATABASE_USERNAME}
  spring.datasource.password=${DATABASE_PASSWORD}
  
  spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
  
  spring.jpa.open-in-view=false
  
  spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
  </code></pre>