aggiungi semplicemente @Version
campo a te @Document
classe e lascia @EnableMongoAuditing
cioè
@Document
public class Profile implements Persistable<String>{
@Version
private Long version;
@Id
private String username;
@CreatedDate
public Date createdDate;
public Profile(String username) {
this.username = username;
}
@Override
public String getId() {
return username;
}
@Override
public boolean isNew() {
return username == null;
}
}
Ecco un problema correlato:https://jira.spring.io/browse/DATAMONGO-946