Class SetFieldValueCommand
- java.lang.Object
-
- com.sodius.mdw.metamodel.integrity.io.command.ExecutableCommandWrapper
-
- com.sodius.mdw.metamodel.integrity.io.command.SetFieldValueCommand
-
- All Implemented Interfaces:
ExecutableCommand
public class SetFieldValueCommand extends ExecutableCommandWrapper implements ExecutableCommand
Updates the value of specificItem
field in the Integrity database.Constraints:
- The
FieldValue
must be owned by itsItem
. - The
FieldValue
must reference aField
.
Notes:
- In case the value is a reference to Items (e.g.
FieldElementValue
orFieldElementListValue
), only references to Items which already exist in the database (i.e. whoseid
is not0
) are created. - In case the value is a reference to Items, you might prefer to use a
CreateRelationshipCommand
to control exactly which relations are to be created. - You might want to group the execution of multiple updates using a
CompoundCommand
. - To set a
FieldIntValue
,FieldDoubleValue
or aFieldBooleanValue
with the valuenull
, you need to use a specific workaround. For that you need to use aFieldStringValue
instead of one of them, referencing theField
to set (setField(Field)
) with the value null (setValue(null)
).
Usage:
new SetFieldValueCommand(myValue).execute();
- See Also:
CompoundCommand
,CreateRelationshipCommand
-
-
Constructor Summary
Constructors Constructor Description SetFieldValueCommand(FieldValue fieldValue)
Instantiates a command to update the value of an item.
-
Method Summary
-
Methods inherited from class com.sodius.mdw.metamodel.integrity.io.command.ExecutableCommandWrapper
execute
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sodius.mdw.metamodel.integrity.io.command.ExecutableCommand
execute
-
-
-
-
Constructor Detail
-
SetFieldValueCommand
public SetFieldValueCommand(FieldValue fieldValue)
Instantiates a command to update the value of an item.- Parameters:
fieldValue
- references the field that must be updated and the new value to assign.
-
-