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
public class EntityFetchGroup extends FetchGroup
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
- Author:
- dclarke, ailitchev
- See Also:
- Serialized Form
-
-
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
Constructors Modifier Constructor Description protectedEntityFetchGroup()EntityFetchGroup(String attributeName)EntityFetchGroup(String[] attributeNames)EntityFetchGroup(Collection<String> attributeNames)EntityFetchGroup(FetchGroup fetchGroup)EntityFetchGroup(FetchGroup fetchGroup, String attributeName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(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.booleanisEntityFetchGroup()booleanisSupersetOf(CoreAttributeGroup anotherGroup)Return true if this EntityFetchGroup is a super-set of the passed in EntityFetchGroup.StringonUnfetchedAttribute(FetchGroupTracker entity, String attributeName)Called on attempt to get value of an attribute that hasn't been fetched yet.StringonUnfetchedAttributeForSet(FetchGroupTracker entity, String attributeName)Called on attempt to assign value to an attribute that hasn't been fetched yet.voidremoveAttribute(String attributeNameOrPath)Remove an attribute from the group.voidsetOnEntity(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 Detail
-
EntityFetchGroup
protected EntityFetchGroup()
-
EntityFetchGroup
public EntityFetchGroup(FetchGroup fetchGroup)
-
EntityFetchGroup
public EntityFetchGroup(String attributeName)
-
EntityFetchGroup
public EntityFetchGroup(Collection<String> attributeNames)
-
EntityFetchGroup
public EntityFetchGroup(String[] attributeNames)
-
EntityFetchGroup
public EntityFetchGroup(FetchGroup fetchGroup, String attributeName)
-
-
Method Detail
-
addAttribute
public void addAttribute(String attributeNameOrPath, CoreAttributeGroup group)
Description 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 classFetchGroup- Parameters:
attributeNameOrPath- A simple attribute, array or attributes forming a pathgroup- - an AttributeGroup to be added.
-
onUnfetchedAttribute
public String onUnfetchedAttribute(FetchGroupTracker entity, String attributeName)
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:
onUnfetchedAttributein classFetchGroup
-
onUnfetchedAttributeForSet
public String onUnfetchedAttributeForSet(FetchGroupTracker entity, String attributeName)
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:
onUnfetchedAttributeForSetin classFetchGroup
-
removeAttribute
public void removeAttribute(String attributeNameOrPath)
Description copied from class:CoreAttributeGroupRemove an attribute from the group.- Overrides:
removeAttributein classCoreAttributeGroup<AttributeItem,ClassDescriptor>
-
setOnEntity
public void setOnEntity(Object entity, AbstractSession session)
Set this EntityFetchGroup on an entity implementingFetchGroupTracker.
-
isEntityFetchGroup
public boolean isEntityFetchGroup()
- Overrides:
isEntityFetchGroupin classFetchGroup
-
isSupersetOf
public boolean isSupersetOf(CoreAttributeGroup anotherGroup)
Return true if this EntityFetchGroup is a super-set of the passed in EntityFetchGroup.- Overrides:
isSupersetOfin classCoreAttributeGroup<AttributeItem,ClassDescriptor>
-
-