@Target(value={TYPE,METHOD,FIELD}) @Retention(value=RUNTIME) public @interface WriteConcern
WriteConcernType.JOURNALED
or by specifying the type of a custom WriteConcern
implementation.
When given on the property-level, this setting will only take effect when the property represents an association. If given for non-association properties, the setting on the property-level will be ignored and the setting from the entity will be applied.
Modifier and Type | Required Element and Description |
---|---|
WriteConcernType |
value
Specifies the write concern to be applied when performing write operations to the annotated entity or property.
|
public abstract WriteConcernType value
Use WriteConcernType.CUSTOM
in conjunction with type()
to specify a custom WriteConcern
implementation. This is useful in cases where the pre-defined configurations are not sufficient, e.g. if you want
to ensure that writes are propagated to a specific number of replicas or given "tag set".
WriteConcernType
public abstract Class<? extends com.mongodb.WriteConcern> type
WriteConcern
implementation. Only takes effect if value()
is set
to WriteConcernType.CUSTOM
. The specified type must have a default (no-args) constructor.WriteConcern
to use when WriteConcernType.CUSTOM
is setCopyright © 2010-2024 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.