Module org.eclipse.persistence.core
Class EntityFetchGroup
java.lang.Object
org.eclipse.persistence.core.queries.CoreAttributeGroup<AttributeItem,ClassDescriptor>
org.eclipse.persistence.queries.AttributeGroup
org.eclipse.persistence.queries.FetchGroup
org.eclipse.persistence.internal.queries.EntityFetchGroup
- All Implemented Interfaces:
Serializable
,Cloneable
EntityFetchGroup reflects the state of the object.
Because EntityFetchGroup doesn't attempt to track
the state of related objects it is flat (non-nested).
- Since:
- EclipseLink 2.1
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.persistence.queries.FetchGroup
entityFetchGroup, rootEntity
Fields inherited from class org.eclipse.persistence.core.queries.CoreAttributeGroup
allsubclasses, isValidated, items, name, subClasses, superClassGroup, type, typeName
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
EntityFetchGroup
(String attributeName) EntityFetchGroup
(String[] attributeNames) EntityFetchGroup
(Collection<String> attributeNames) EntityFetchGroup
(FetchGroup fetchGroup) EntityFetchGroup
(FetchGroup fetchGroup, String attributeName) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(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.boolean
boolean
isSupersetOf
(CoreAttributeGroup anotherGroup) Return true if this EntityFetchGroup is a super-set of the passed in EntityFetchGroup.onUnfetchedAttribute
(FetchGroupTracker entity, String attributeName) Called on attempt to get value of an attribute that hasn't been fetched yet.onUnfetchedAttributeForSet
(FetchGroupTracker entity, String attributeName) Called on attempt to assign value to an attribute that hasn't been fetched yet.void
removeAttribute
(String attributeNameOrPath) Remove an attribute from the group.void
setOnEntity
(Object entity, AbstractSession session) Set this EntityFetchGroup on an entity implementingFetchGroupTracker
.Methods inherited from class org.eclipse.persistence.queries.FetchGroup
addAttribute, addAttributeKey, clone, getEntityFetchGroup, getGroup, getRootEntity, isFetchGroup, newGroup, setRootEntity, setShouldLoad, setShouldLoadAll, setSubclassShouldLoad, shouldLoad, toLoadGroup, toLoadGroupLoadOnly
Methods inherited from class org.eclipse.persistence.queries.AttributeGroup
addAttribute, findGroup, getItem, isConcurrent, isCopyGroup, isLoadGroup, isSupersetOf, newItem, newItem, toCopyGroup, toCopyGroup, toFetchGroup, toFetchGroup, toLoadGroup
Methods inherited from class org.eclipse.persistence.core.queries.CoreAttributeGroup
addAttribute, addAttributes, clone, containsAttribute, containsAttributeInternal, convert, convertClassNamesToClasses, equals, getAllItems, getAttributeNames, getItem, getItems, getName, getSubClassGroups, getType, getTypeName, hashCode, hasInheritance, hasItems, insertSubClass, isValidated, setAllSubclasses, setAttributeNames, setName, toString, toStringAdditionalInfo, toStringItems, toStringPath
-
Constructor Details
-
EntityFetchGroup
protected EntityFetchGroup() -
EntityFetchGroup
-
EntityFetchGroup
-
EntityFetchGroup
-
EntityFetchGroup
-
EntityFetchGroup
-
-
Method Details
-
addAttribute
Description copied from class:CoreAttributeGroup
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:
group.addAttribute("firstName", group1);
Note that existing group corresponding to attributeNameOrPath will be overridden with the passed group.
group.addAttribute("manager.address", group2);- Overrides:
addAttribute
in classFetchGroup
- Parameters:
attributeNameOrPath
- A simple attribute, array or attributes forming a pathgroup
- - an AttributeGroup to be added.
-
onUnfetchedAttribute
Called on attempt to get value of an attribute that hasn't been fetched yet. Returns an error message in case exception should be thrown by the calling method, null otherwise.- Overrides:
onUnfetchedAttribute
in classFetchGroup
-
onUnfetchedAttributeForSet
Called on attempt to assign value to an attribute that hasn't been fetched yet. Returns an error message in case exception should be thrown by the calling method, null otherwise.- Overrides:
onUnfetchedAttributeForSet
in classFetchGroup
-
removeAttribute
Description copied from class:CoreAttributeGroup
Remove an attribute from the group.- Overrides:
removeAttribute
in classCoreAttributeGroup<AttributeItem,
ClassDescriptor>
-
setOnEntity
Set this EntityFetchGroup on an entity implementingFetchGroupTracker
. -
isEntityFetchGroup
public boolean isEntityFetchGroup()- Overrides:
isEntityFetchGroup
in classFetchGroup
-
isSupersetOf
Return true if this EntityFetchGroup is a super-set of the passed in EntityFetchGroup.- Overrides:
isSupersetOf
in classCoreAttributeGroup<AttributeItem,
ClassDescriptor>
-