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 specificItemfield in the Integrity database.Constraints:
- The
FieldValuemust be owned by itsItem. - The
FieldValuemust reference aField.
Notes:
- In case the value is a reference to Items (e.g.
FieldElementValueorFieldElementListValue), only references to Items which already exist in the database (i.e. whoseidis not0) are created. - In case the value is a reference to Items, you might prefer to use a
CreateRelationshipCommandto 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,FieldDoubleValueor aFieldBooleanValuewith the valuenull, you need to use a specific workaround. For that you need to use aFieldStringValueinstead of one of them, referencing theFieldto 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.
-
-