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:
java.io.Serializable
,java.lang.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 protected
EntityFetchGroup()
EntityFetchGroup(java.lang.String attributeName)
EntityFetchGroup(java.lang.String[] attributeNames)
EntityFetchGroup(java.util.Collection<java.lang.String> attributeNames)
EntityFetchGroup(FetchGroup fetchGroup)
EntityFetchGroup(FetchGroup fetchGroup, java.lang.String attributeName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttribute(java.lang.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
isEntityFetchGroup()
boolean
isSupersetOf(CoreAttributeGroup anotherGroup)
Return true if this EntityFetchGroup is a super-set of the passed in EntityFetchGroup.java.lang.String
onUnfetchedAttribute(FetchGroupTracker entity, java.lang.String attributeName)
Called on attempt to get value of an attribute that hasn't been fetched yet.java.lang.String
onUnfetchedAttributeForSet(FetchGroupTracker entity, java.lang.String attributeName)
Called on attempt to assign value to an attribute that hasn't been fetched yet.void
removeAttribute(java.lang.String attributeNameOrPath)
Remove an attribute from the group.void
setOnEntity(java.lang.Object entity, AbstractSession session)
Set this EntityFetchGroup on an entity implementingFetchGroupTracker
.-
Methods inherited from class org.eclipse.persistence.queries.FetchGroup
addAttribute, addAttributeKey, clone, getAttributes, 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(java.lang.String attributeName)
-
EntityFetchGroup
public EntityFetchGroup(java.util.Collection<java.lang.String> attributeNames)
-
EntityFetchGroup
public EntityFetchGroup(java.lang.String[] attributeNames)
-
EntityFetchGroup
public EntityFetchGroup(FetchGroup fetchGroup, java.lang.String attributeName)
-
-
Method Detail
-
addAttribute
public void addAttribute(java.lang.String attributeNameOrPath, CoreAttributeGroup group)
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
public java.lang.String onUnfetchedAttribute(FetchGroupTracker entity, java.lang.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:
onUnfetchedAttribute
in classFetchGroup
-
onUnfetchedAttributeForSet
public java.lang.String onUnfetchedAttributeForSet(FetchGroupTracker entity, java.lang.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:
onUnfetchedAttributeForSet
in classFetchGroup
-
removeAttribute
public void removeAttribute(java.lang.String attributeNameOrPath)
Description copied from class:CoreAttributeGroup
Remove an attribute from the group.- Overrides:
removeAttribute
in classCoreAttributeGroup<AttributeItem,ClassDescriptor>
-
setOnEntity
public void setOnEntity(java.lang.Object entity, AbstractSession session)
Set this EntityFetchGroup on an entity implementingFetchGroupTracker
.
-
isEntityFetchGroup
public boolean isEntityFetchGroup()
- Overrides:
isEntityFetchGroup
in classFetchGroup
-
isSupersetOf
public boolean isSupersetOf(CoreAttributeGroup anotherGroup)
Return true if this EntityFetchGroup is a super-set of the passed in EntityFetchGroup.- Overrides:
isSupersetOf
in classCoreAttributeGroup<AttributeItem,ClassDescriptor>
-
-