public class PlasmaCopyHelper extends Object implements CopyHelper
Note that copied data objects
have the same data properties as the source but have new
(and therefore different) underlying UUID
and other management properties which are not defined within the
source Type. Use copied data objects to help automate and save
save effort when creating NEW data objects. To simply link/add
and existing data object to a new data graph, first use DataObject.detach() to
remove it from its graph. Than add it to a another graph.
| Modifier and Type | Field and Description |
|---|---|
static PlasmaCopyHelper |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
DataObject |
copy(DataObject dataObject)
Create a deep copy of the DataObject tree.
|
DataObject |
copy(DataObject dataObject,
Type[] referenceTypes)
Create a deep copy of the DataObject tree while exempting all
DataObject nodes with an SDO type found in the given reference Types
array.
|
DataObject |
copyAsReference(DataObject dataObject)
Create a deep copy of the given dataObject tree but where
the UUID
and other instance properties are copied from the given data object copied as well.
|
DataObject |
copyShallow(DataObject dataObject)
Create a shallow copy of the DataObject dataObject:
Creates a new DataObject copiedDataObject with the same values
as the source dataObject for each property where
property.getType().isDataType() is true.
|
DataObject |
copyShallowAsReference(DataObject dataObject)
Create a shallow copy of the given dataObject but where
the UUID
and other instance properties are copied from the given data object copied as well.
|
static PlasmaCopyHelper |
instance() |
public static volatile PlasmaCopyHelper INSTANCE
public static PlasmaCopyHelper instance()
public DataObject copyShallow(DataObject dataObject)
Note that in general copied data objects
have the same data properties as the source but have new
(and therefore different) underlying UUID
and other management properties which are not defined within the
source Type. Use copied data objects to help automate and save
save effort when creating NEW data objects. To simply link/add
and existing data object to a new data graph, first use DataObject.detach() to
remove it from its graph. Than add it to a another graph.
copyShallow in interface CopyHelperdataObject - to be copiedpublic DataObject copyShallowAsReference(DataObject dataObject)
dataObject - public DataObject copy(DataObject dataObject)
contained
DataObjects recursively.
Values of Properties are copied as in shallow copy,
and values of Properties where
property.getType().isDataType() is false
are copied where each value copied must be a
DataObject contained by the source dataObject.
If a DataObject is outside the DataObject tree and the
property is bidirectional, then the DataObject is skipped.
If a DataObject is outside the DataObject tree and the
property is unidirectional, then the same DataObject is referenced.
Read-only properties are copied.
If any DataObject referenced is not in the containment
tree an IllegalArgumentException is thrown.
The Logging state in the source ChangeSummary is not replicated in the
target ChangeSummary. All copied data objects are in a 'created' state
ready to be used for insert operations.
Note that in general copied data objects
have the same data properties as the source but have new
(and therefore different) underlying UUID
and other management properties which are not defined within the
source Type. Use copied data objects to help automate and save
save effort when creating NEW data objects. To simply link/add
an existing data object to a new data graph, first use DataObject.detach() to
remove it from its graph. Than add it to a another graph.
copy in interface CopyHelperdataObject - to be copied.IllegalArgumentException - if any referenced DataObject
is not part of the containment tree.public DataObject copyAsReference(DataObject dataObject)
DataObject.detach() to
remove it from its graph. Than add it to a another graph.dataObject - public DataObject copy(DataObject dataObject, Type[] referenceTypes)
contained
DataObjects recursively.
Values of Properties are copied as in shallow copy,
and values of Properties where
property.getType().isDataType() is false
are copied where each value copied must be a
DataObject contained by the source dataObject.
If a DataObject is outside the DataObject tree and the
property is bidirectional, then the DataObject is skipped.
If a DataObject is outside the DataObject tree and the
property is unidirectional, then the same DataObject is referenced.
Read-only properties are copied.
If any DataObject referenced is not in the containment
tree an IllegalArgumentException is thrown.
The Logging state in the source ChangeSummary is not replicated in the
target ChangeSummary. All copied data objects are in a 'created' state
ready to be used for insert operations.
Note that copied data objects
have the same data properties as the source but have new
(and therefore different) underlying UUID
and other management properties which are not defined within the
source Type. Use copied data objects to help automate and save
save effort when creating NEW data objects. To simply link/add
and existing data object to a new data graph, first use DataObject.detach() to
remove it from its graph. Than add it to a another graph.
dataObject - to be copied.referenceTypes - an array of types which areIllegalArgumentException - if any referenced DataObject
is not part of the containment tree.Copyright © 2017. All rights reserved.