public interface Replace<T extends Pojo> extends DataModifyingStatement<T>
Update
for
all properties of a record.
The only distinction to a regular Update
is that if Replace is used
and the associated where
expression yields no result, a
new record will be insterted into Storage.
The result of this operation is undefined if the where
expression
matches more than one record in storage.
DEFAULT_STATUS_FAILURE, DEFAULT_STATUS_SUCCESS
Modifier and Type | Method and Description |
---|---|
int |
apply()
Applies this
Replace operation to the storage. |
void |
set(String key,
Object value)
Sets a field in a found record to the specified value.
|
void |
where(Expression expression)
Specifies what criteria to use to find the record to replace
|
getRawDuplicate
void set(String key, Object value)
key
- the name of the field to update.value
- the value with which to update the field.void where(Expression expression)
int apply()
Replace
operation to the storage.apply
in interface DataModifyingStatement<T extends Pojo>
StorageException
- If the operation failsCopyright © 2016. All Rights Reserved.