java.lang.Object
org.eclipse.persistence.core.queries.CoreAttributeGroup<AttributeItem,ClassDescriptor>
 
org.eclipse.persistence.queries.AttributeGroup
org.eclipse.persistence.sessions.CopyGroup
- All Implemented Interfaces:
- Serializable,- Cloneable
Purpose: Define how an object is to be copied.
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:
- Indicate through CASCADE levels the depth relationships will copied.
- Indicate if PK attributes should be copied with existing value or should be reset.
- Copies only the attributes found in the group.
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDepth level indicating that all relationships with mappings should be used when building the copied object graphstatic final intDepth level indicating that only relationships with mapping indicated privately- owned should be copiedstatic final intDepth level indicating that only the attributes found in the attribute group should be copiedprotected Mapprotected intPolicy depth that determines how the copy will cascade to the object's related partsstatic final intDepth level indicating that NO relationships should be included in the copy.protected AbstractSessionprotected booleanprotected booleanFields inherited from class org.eclipse.persistence.core.queries.CoreAttributeGroupallsubclasses, isValidated, items, name, subClasses, superClassGroup, type, typeName
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddAttribute(String attributeNameOrPath, CoreAttributeGroup group) 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.voidaddAttribute(String attributeNameOrPath, CopyGroup group) voidPUBLIC: Set if the copy should cascade all relationships when copying the object(s).voidPUBLIC: Set if the copy should cascade only those relationships that are configured as privately-owned.voidPUBLIC: Set if the copy should cascade only those attributes that are found in the group.clone()voidPUBLIC: Set if the copy should not cascade relationships when copying the object(s)INTERNAL: Get the session.intgetDepth()INTERNAL: Return the cascade depth.Returns CopyGroup corresponding to the passed (possibly nested) attribute.INTERNAL: Return the session.booleanINTERNAL: This method is used internally when converting to a copy group.protected CopyGroupnewGroup(String name, CoreAttributeGroup parent) Subclass may create different types.voidINTERNAL: Set the copies.voidsetDepth(int newDepth) INTERNAL: Set the cascade depth.voidsetSession(AbstractSession newSession) INTERNAL: Set the session.voidsetShouldResetPrimaryKey(boolean newShouldResetPrimaryKey) PUBLIC: Set if the primary key should be reset to null.voidsetShouldResetVersion(boolean newShouldResetVersion) PUBLIC: Set if the version should be reset to null.booleanPUBLIC: Return true if has been configured to CASCADE_ALL_PARTS or CASCADE_PRIVATE_PARTS.booleanPUBLIC: Return true if should CASCADE_ALL_PARTSbooleanPUBLIC: Return true if should CASCADE_PRIVATE_PARTSbooleanPUBLIC: Return true if should CASCADE_TREEbooleanPUBLIC: Return if the primary key should be reset to null.booleanPUBLIC: Return if the version should be reset to null.protected StringINTERNAL:Methods inherited from class org.eclipse.persistence.queries.AttributeGroupaddAttribute, findGroup, getItem, isConcurrent, isLoadGroup, isSupersetOf, newItem, newItem, toCopyGroup, toCopyGroup, toFetchGroup, toFetchGroup, toLoadGroup, toLoadGroupMethods inherited from class org.eclipse.persistence.core.queries.CoreAttributeGroupaddAttribute, addAttribute, addAttributeKey, addAttributes, clone, containsAttribute, containsAttributeInternal, convert, convertClassNamesToClasses, equals, getAllItems, getAttributeNames, getItem, getItems, getName, getSubClassGroups, getType, getTypeName, hashCode, hasInheritance, hasItems, insertSubClass, isFetchGroup, isSupersetOf, isValidated, removeAttribute, setAllSubclasses, setAttributeNames, setName, toString, toStringItems, toStringPath
- 
Field Details- 
shouldResetPrimaryKeyprotected boolean shouldResetPrimaryKey
- 
shouldResetVersionprotected boolean shouldResetVersion
- 
session
- 
copies
- 
depthprotected int depthPolicy depth that determines how the copy will cascade to the object's related parts
- 
NO_CASCADEpublic static final int NO_CASCADEDepth 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- See Also:
 
- 
CASCADE_PRIVATE_PARTSpublic static final int CASCADE_PRIVATE_PARTSDepth level indicating that only relationships with mapping indicated privately- owned should be copied- See Also:
 
- 
CASCADE_ALL_PARTSpublic static final int CASCADE_ALL_PARTSDepth level indicating that all relationships with mappings should be used when building the copied object graph- See Also:
 
- 
CASCADE_TREEpublic static final int CASCADE_TREEDepth level indicating that only the attributes found in the attribute group should be copied- See Also:
 
 
- 
- 
Constructor Details- 
CopyGrouppublic CopyGroup()PUBLIC: By default only copy the attributes found in the attribute group and don't null primary keys.
- 
CopyGroupPUBLIC: By default only copy the attributes found in the attribute group and don't null primary keys.
 
- 
- 
Method Details- 
cascadeAllPartspublic void cascadeAllParts()PUBLIC: Set if the copy should cascade all relationships when copying the object(s).
- 
cascadePrivatePartspublic void cascadePrivateParts()PUBLIC: Set if the copy should cascade only those relationships that are configured as privately-owned.
- 
cascadeTreepublic void cascadeTree()PUBLIC: Set if the copy should cascade only those attributes that are found in the group.
- 
dontCascadepublic void dontCascade()PUBLIC: Set if the copy should not cascade relationships when copying the object(s)
- 
getCopiesINTERNAL: Get the session.
- 
getDepthpublic int getDepth()INTERNAL: Return the cascade depth.
- 
getSessionINTERNAL: Return the session.
- 
setCopiesINTERNAL: Set the copies.
- 
setDepthpublic void setDepth(int newDepth) INTERNAL: Set the cascade depth.
- 
setSessionINTERNAL: Set the session.
- 
setShouldResetPrimaryKeypublic void setShouldResetPrimaryKey(boolean newShouldResetPrimaryKey) PUBLIC: Set if the primary key should be reset to null.
- 
setShouldResetVersionpublic void setShouldResetVersion(boolean newShouldResetVersion) PUBLIC: Set if the version should be reset to null.
- 
shouldCascadepublic boolean shouldCascade()PUBLIC: Return true if has been configured to CASCADE_ALL_PARTS or CASCADE_PRIVATE_PARTS.
- 
shouldCascadeAllPartspublic boolean shouldCascadeAllParts()PUBLIC: Return true if should CASCADE_ALL_PARTS
- 
shouldCascadePrivatePartspublic boolean shouldCascadePrivateParts()PUBLIC: Return true if should CASCADE_PRIVATE_PARTS
- 
shouldCascadeTreepublic boolean shouldCascadeTree()PUBLIC: Return true if should CASCADE_TREE
- 
shouldResetPrimaryKeypublic boolean shouldResetPrimaryKey()PUBLIC: Return if the primary key should be reset to null.
- 
shouldResetVersionpublic boolean shouldResetVersion()PUBLIC: Return if the version should be reset to null.
- 
toStringAdditionalInfoINTERNAL:- Overrides:
- toStringAdditionalInfoin class- CoreAttributeGroup<AttributeItem,- ClassDescriptor> 
 
- 
addAttributeDescription copied from class:CoreAttributeGroupAdd 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: group.addAttribute("firstName", group1);Note that existing group corresponding to attributeNameOrPath will be overridden with the passed group.
 group.addAttribute("manager.address", group2);- Overrides:
- addAttributein class- CoreAttributeGroup<AttributeItem,- ClassDescriptor> 
- Parameters:
- attributeNameOrPath- A simple attribute, array or attributes forming a path
- group- - an AttributeGroup to be added.
 
- 
addAttribute
- 
isCopyGrouppublic boolean isCopyGroup()Description copied from class:AttributeGroupINTERNAL: This method is used internally when converting to a copy group.- Overrides:
- isCopyGroupin class- AttributeGroup
 
- 
clone- Overrides:
- clonein class- AttributeGroup
 
- 
getGroupReturns CopyGroup corresponding to the passed (possibly nested) attribute.- Overrides:
- getGroupin class- AttributeGroup
 
- 
newGroupDescription copied from class:AttributeGroupSubclass may create different types.- Overrides:
- newGroupin class- AttributeGroup
 
 
-