You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a java class with a version field annotated with @Version
public class BaseDocument {
@Id private String id;
@CreatedDate private Instant createdAt;
@LastModifiedDate private Instant updatedAt;
@Version private Long version;
}
When using .save() method it automatically generate the version and keep track of it, but if I use findAndReplace with an object where version field is null, it keeps it as null.
I was expecting that findAndReplace would auto generate the version if not set on the object. So is this as design or a bug in this specific method?
The text was updated successfully, but these errors were encountered:
Thank you @fcappi for reaching out.
The behaviour is by design - we'll update the reference documentation to be more precise on what to expect when using @Version.
Hi,
I have a java class with a version field annotated with @Version
When using .save() method it automatically generate the version and keep track of it, but if I use findAndReplace with an object where version field is null, it keeps it as null.
I was expecting that findAndReplace would auto generate the version if not set on the object. So is this as design or a bug in this specific method?
The text was updated successfully, but these errors were encountered: