Description: This is for usage with the object copying feature, not the unit of work. This is useful for copying an entire object graph as part of the host application's logic.
Responsibilities:
Session#copy(Object, AttributeGroup)
| Modifier and Type | Field and Description |
|---|---|
| public static final int | CASCADE_ALL_PARTS
Depth level indicating that all relationships with mappings should be used when building the copied object graph |
| public static final int | CASCADE_PRIVATE_PARTS
Depth level indicating that only relationships with mapping indicated privately- owned should be copied |
| public static final int | CASCADE_TREE
Depth level indicating that only the attributes found in the attribute group should be copied |
| protected Map | |
| protected int | depth
Policy depth that determines how the copy will cascade to the object's related parts |
| public static final int | NO_CASCADE
Depth level indicating that NO relationships should be included in the copy. |
| protected transient AbstractSession | |
| protected boolean | |
| protected boolean |
| Access | Constructor and Description |
|---|---|
| public | CopyGroup()
PUBLIC: By default only copy the attributes found in the attribute group and don't null primary keys. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAttribute(String
A simple attribute, array or attributes forming a path attributeNameOrPath, CoreAttributeGroup<ATTRIBUTE_ITEM extends CoreAttributeItem, DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>> - an AttributeGroup to be added. group)Overrides org. |
| public void | |
| public void | cascadeAllParts()
PUBLIC: Set if the copy should cascade all relationships when copying the object(s). |
| public void | cascadePrivateParts()
PUBLIC: Set if the copy should cascade only those relationships that are configured as privately-owned. |
| public void | cascadeTree()
PUBLIC: Set if the copy should cascade only those attributes that are found in the group. |
| public CopyGroup | clone()
Overrides org. |
| public void | |
| public Map | |
| public int | |
| public CopyGroup | getGroup(String attributeNameOrPath)
Overrides org. |
| public AbstractSession | |
| public boolean | isCopyGroup()
Overrides org. |
| protected CopyGroup | newGroup(String name, CoreAttributeGroup<ATTRIBUTE_ITEM extends CoreAttributeItem, DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>> parent)
Overrides org. |
| public void | |
| public void | |
| public void | |
| public void | setShouldResetPrimaryKey(boolean newShouldResetPrimaryKey)
PUBLIC: Set if the primary key should be reset to null. |
| public void | setShouldResetVersion(boolean newShouldResetVersion)
PUBLIC: Set if the version should be reset to null. |
| public boolean | shouldCascade()
PUBLIC: Return true if has been configured to CASCADE_ALL_PARTS or CASCADE_PRIVATE_PARTS. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| protected String |
| CASCADE_ALL_PARTS | back to summary |
|---|---|
| public static final int CASCADE_ALL_PARTS Depth level indicating that all relationships with mappings should be used when building the copied object graph | |
| CASCADE_PRIVATE_PARTS | back to summary |
|---|---|
| public static final int CASCADE_PRIVATE_PARTS Depth level indicating that only relationships with mapping indicated privately- owned should be copied | |
| CASCADE_TREE | back to summary |
|---|---|
| public static final int CASCADE_TREE Depth level indicating that only the attributes found in the attribute group should be copied | |
| copies | back to summary |
|---|---|
| protected Map<K, V> copies | |
| depth | back to summary |
|---|---|
| protected int depth Policy depth that determines how the copy will cascade to the object's related parts | |
| NO_CASCADE | back to summary |
|---|---|
| public static final int NO_CASCADE Depth level indicating that NO relationships should be included in the copy. Relationships that are not copied will include the default value of the object's instantiation policy | |
| session | back to summary |
|---|---|
| protected transient AbstractSession session | |
| shouldResetPrimaryKey | back to summary |
|---|---|
| protected boolean shouldResetPrimaryKey | |
| shouldResetVersion | back to summary |
|---|---|
| protected boolean shouldResetVersion | |
| CopyGroup | back to summary |
|---|---|
| public CopyGroup() PUBLIC: By default only copy the attributes found in the attribute group and don't null primary keys. | |
| CopyGroup | back to summary |
|---|---|
| public CopyGroup(String name) PUBLIC: By default only copy the attributes found in the attribute group and don't null primary keys. | |
| addAttribute | back to summary |
|---|---|
| public void addAttribute(String attributeNameOrPath, CoreAttributeGroup<ATTRIBUTE_ITEM extends CoreAttributeItem, DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>> group) Overrides org. Doc from org. Add a basic attribute or nested attribute with each String representing an attribute on the path to what needs to be included in the AttributeGroup.
Example:
| |
| addAttribute | back to summary |
|---|---|
| public void addAttribute(String attributeNameOrPath, CopyGroup group) | |
| cascadeAllParts | back to summary |
|---|---|
| public void cascadeAllParts() PUBLIC: Set if the copy should cascade all relationships when copying the object(s). | |
| cascadePrivateParts | back to summary |
|---|---|
| public void cascadePrivateParts() PUBLIC: Set if the copy should cascade only those relationships that are configured as privately-owned. | |
| cascadeTree | back to summary |
|---|---|
| public void cascadeTree() PUBLIC: Set if the copy should cascade only those attributes that are found in the group. | |
| clone | back to summary |
|---|---|
| public CopyGroup clone() Overrides org. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by | |
| dontCascade | back to summary |
|---|---|
| public void dontCascade() PUBLIC: Set if the copy should not cascade relationships when copying the object(s) | |
| getCopies | back to summary |
|---|---|
| public Map INTERNAL: Get the session. | |
| getDepth | back to summary |
|---|---|
| public int getDepth() INTERNAL: Return the cascade depth. | |
| getGroup | back to summary |
|---|---|
| public CopyGroup getGroup(String attributeNameOrPath) Overrides org. Returns CopyGroup corresponding to the passed (possibly nested) attribute.
| |
| getSession | back to summary |
|---|---|
| public AbstractSession getSession() INTERNAL: Return the session. | |
| isCopyGroup | back to summary |
|---|---|
| public boolean isCopyGroup() Overrides org. Doc from org. INTERNAL: This method is used internally when converting to a copy group.
| |
| newGroup | back to summary |
|---|---|
| protected CopyGroup newGroup(String name, CoreAttributeGroup<ATTRIBUTE_ITEM extends CoreAttributeItem, DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>> parent) Overrides org. Doc from org. Subclass may create different types.
| |
| setCopies | back to summary |
|---|---|
| public void setCopies(Map<K, V> newCopies) INTERNAL: Set the copies. | |
| setDepth | back to summary |
|---|---|
| public void setDepth(int newDepth) INTERNAL: Set the cascade depth. | |
| setSession | back to summary |
|---|---|
| public void setSession(AbstractSession newSession) INTERNAL: Set the session. | |
| setShouldResetPrimaryKey | back to summary |
|---|---|
| public void setShouldResetPrimaryKey(boolean newShouldResetPrimaryKey) PUBLIC: Set if the primary key should be reset to null. | |
| setShouldResetVersion | back to summary |
|---|---|
| public void setShouldResetVersion(boolean newShouldResetVersion) PUBLIC: Set if the version should be reset to null. | |
| shouldCascade | back to summary |
|---|---|
| public boolean shouldCascade() PUBLIC: Return true if has been configured to CASCADE_ALL_PARTS or CASCADE_PRIVATE_PARTS. | |
| shouldCascadeAllParts | back to summary |
|---|---|
| public boolean shouldCascadeAllParts() PUBLIC: Return true if should CASCADE_ALL_PARTS | |
| shouldCascadePrivateParts | back to summary |
|---|---|
| public boolean shouldCascadePrivateParts() PUBLIC: Return true if should CASCADE_PRIVATE_PARTS | |
| shouldCascadeTree | back to summary |
|---|---|
| public boolean shouldCascadeTree() PUBLIC: Return true if should CASCADE_TREE | |
| shouldResetPrimaryKey | back to summary |
|---|---|
| public boolean shouldResetPrimaryKey() PUBLIC: Return if the primary key should be reset to null. | |
| shouldResetVersion | back to summary |
|---|---|
| public boolean shouldResetVersion() PUBLIC: Return if the version should be reset to null. | |
| toStringAdditionalInfo | back to summary |
|---|---|
| protected String toStringAdditionalInfo() Overrides org. INTERNAL:
| |