Top Description Fields Constructors Methods
org.hibernate

public sealed Enum ReplicationMode

extends Enum<ReplicationMode>
Class Inheritance
Imports
org.hibernate.type.VersionType

Represents a replication strategy.
Author
Gavin King
See Also
Session#replicate(Object, ReplicationMode)

Field Summary

Modifier and TypeField and Description
public static final ReplicationMode
EXCEPTION

Throw an exception when a row already exists.

public static final ReplicationMode
IGNORE

Ignore replicated entities when a row already exists.

public static final ReplicationMode
LATEST_VERSION

When a row already exists, choose the latest version.

public static final ReplicationMode
OVERWRITE

Overwrite existing rows when a row already exists.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public abstract boolean

Returns:

true indicates the data should be overwritten; false indicates it should not.
shouldOverwriteCurrentVersion
(Object
The entity being replicated
entity
,
Object
The version currently on the target database table.
currentVersion
,
Object
The replicating version
newVersion
,
VersionType<T>
The version type
versionType
)

Determine whether the mode dictates that the data being replicated should overwrite the data found.

public static ReplicationMode
public static ReplicationMode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

EXCEPTIONback to summary
public static final ReplicationMode EXCEPTION

Throw an exception when a row already exists.

IGNOREback to summary
public static final ReplicationMode IGNORE

Ignore replicated entities when a row already exists.

LATEST_VERSIONback to summary
public static final ReplicationMode LATEST_VERSION

When a row already exists, choose the latest version.

OVERWRITEback to summary
public static final ReplicationMode OVERWRITE

Overwrite existing rows when a row already exists.

Constructor Detail

ReplicationModeback to summary
private ReplicationMode()

Method Detail

shouldOverwriteCurrentVersionback to summary
public abstract boolean shouldOverwriteCurrentVersion(Object entity, Object currentVersion, Object newVersion, VersionType<T> versionType)

Determine whether the mode dictates that the data being replicated should overwrite the data found.

Parameters
entity:Object

The entity being replicated

currentVersion:Object

The version currently on the target database table.

newVersion:Object

The replicating version

versionType:VersionType<T>

The version type

Returns:boolean

true indicates the data should be overwritten; false indicates it should not.

valueOfback to summary
public static ReplicationMode valueOf(String name)
valuesback to summary
public static ReplicationMode[] values()