public class VersionValue extends Object implements UnsavedValueStrategy
| Modifier and Type | Field and Description |
|---|---|
static VersionValue |
NEGATIVE
Assume the transient instance is newly instantiated if the version
is negative, otherwise assume it is a detached instance.
|
static VersionValue |
NULL
Assume the transient instance is newly instantiated if the version
is null, otherwise assume it is a detached instance.
|
static VersionValue |
UNDEFINED
Assume the transient instance is newly instantiated if the version
is null, otherwise defer to the identifier unsaved-value.
|
| Modifier | Constructor and Description |
|---|---|
protected |
VersionValue() |
|
VersionValue(Object value)
Assume the transient instance is newly instantiated if
its version is null or equal to value
|
public static final VersionValue NULL
public static final VersionValue UNDEFINED
public static final VersionValue NEGATIVE
protected VersionValue()
public VersionValue(Object value)
value - value to compare topublic Boolean isUnsaved(Object version) throws MappingException
UnsavedValueStrategyisUnsaved in interface UnsavedValueStrategyversion - The value to be testedtrue indicates the value corresponds to unsaved data (aka, transient state; false
indicates the value does not corresponds to unsaved data (aka, detached state); null indicates that
this strategy was not able to determine conclusively.MappingExceptionpublic Object getDefaultValue(Object currentValue)
UnsavedValueStrategygetDefaultValue in interface UnsavedValueStrategycurrentValue - The current state value.Copyright © 2018 JBoss by Red Hat. All rights reserved.