Package com.apple.foundationdb.record
Class RecordIndexUniquenessViolation
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.apple.foundationdb.util.LoggableException
-
- com.apple.foundationdb.record.RecordCoreException
-
- com.apple.foundationdb.record.RecordIndexUniquenessViolation
-
- All Implemented Interfaces:
LoggableKeysAndValues<LoggableException>
,Serializable
@API(STABLE) public class RecordIndexUniquenessViolation extends RecordCoreException
An exception thrown when there is an attempt to store a duplicate value in a unique index. This exception is not necessarily thrown by the specificsaveRecord
that caused the violation, but it will always be thrown beforecommit
would have completed successfully. When this is thrown,commit
will not complete successfully, whether it was thrown earlier or fromFDBRecordContext.commit()
itself.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RecordIndexUniquenessViolation(Index index, IndexEntry indexEntry, Tuple primaryKey, Tuple existingKey)
RecordIndexUniquenessViolation(String message, RecordIndexUniquenessViolation cause)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tuple
getExistingKey()
Get the existing key of this uniqueness violation.Index
getIndex()
Get the index associated with this uniqueness violation.IndexEntry
getIndexEntry()
Get the index value of this uniqueness violation.Tuple
getPrimaryKey()
Get the primary key of this uniqueness violation.-
Methods inherited from class com.apple.foundationdb.record.RecordCoreException
addLogInfo, addLogInfo
-
Methods inherited from class com.apple.foundationdb.util.LoggableException
exportLogInfo, getLogInfo
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
RecordIndexUniquenessViolation
public RecordIndexUniquenessViolation(@Nonnull Index index, IndexEntry indexEntry, Tuple primaryKey, Tuple existingKey)
-
RecordIndexUniquenessViolation
public RecordIndexUniquenessViolation(String message, RecordIndexUniquenessViolation cause)
-
-
Method Detail
-
getIndex
@Nonnull public Index getIndex()
Get the index associated with this uniqueness violation.- Returns:
- the index associated with this uniqueness violation
-
getIndexEntry
@Nullable public IndexEntry getIndexEntry()
Get the index value of this uniqueness violation. This is the value the index took for some record that conflicted with the value for a different record.- Returns:
- the index key of this uniqueness violation
-
getPrimaryKey
@Nullable public Tuple getPrimaryKey()
Get the primary key of this uniqueness violation. This is the record that was added that triggered the uniqueness violation- Returns:
- the primary key of this uniqueness violation
-
-