- All Implemented Interfaces:
Serializable,Comparable<MutationDetection>
@DbJson properties.
The @DbJson properties are often plain beans and we use Jackson to store them in
json form. These are the options for detecting if a bean as been mutated typically by
comparing the json content (SOURCE mode) or comparing a hash/checksum of the json content
(HASH mode).
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic MutationDetectionReturns the enum constant of this type with the specified name.static MutationDetection[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
Defaults to using HASH mode for plain Jackson beans. Collection types (List, Set, Map) use ModifyAware wrapper types to detect when the collection has been mutated but may not be aware of mutations of the elements. -
NONE
No dirty detection. The property is only included in an update when the property itself has been set. There is no attempt to detect if the bean has been mutated. -
HASH
Dirty detection using a hash checksum function on json content.A CRC32 checksum value of the json content is computed and held. For updates the checksum is compared and when it is different the property is deemed dirty and included in an update.
Unlike SOURCE mode this does not support generating an 'oldValue' for change logs and persist listeners.
-
SOURCE
Dirty detection using the original json content.The json content is kept for this property and dirty detection is performed by comparing the json content. As such this approach uses more memory than HASH mode.
This mode supports 'oldValue' for change logs and persist listeners. The 'oldValue' of a mutated json bean can be rebuilt using the original json content. This 'oldValue' is then available for change logs and persist listeners.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-