I use JaVers 6.10.0 in Spring Boot to store versions of this class:
class AUserBusinessData {
@Id
@PropertyName("i")
private Long id;
@PropertyName("s")
JHAEUserStatus status;
}
public enum JHAEUserStatus {
ACTIVE,
INACTIVE,
}
JaVers stores this in the STATE
column of the JV_SNAPSHOT
table as follows:
{
"i": 1202,
"s": "ACTIVE",
}
Is there a way for me to store the enum as an ordinal (i.e, 0
or 1
in this case) instead of a string (e.g. "ACTIVE"
, as seen above)?
There is no such option out-of-the-box. You can try to write custom JSON Type Adapter, one per each enum type.