public class EntityFetchOptions
Helper class to determine which properties should be eagerly fetched based on the fields in a graphql.schema.DataFetchingEnvironment.
Modifiers | Name | Description |
---|---|---|
protected java.util.Set<java.lang.String> |
associationNames |
|
protected org.grails.datastore.mapping.model.PersistentEntity |
entity |
|
protected java.lang.String |
propertyName |
Constructor and description |
---|
EntityFetchOptions
(java.lang.Class<?> entityClass) |
EntityFetchOptions
(java.lang.Class<?> entityClass, java.lang.String projectionName) |
EntityFetchOptions
(org.grails.datastore.mapping.model.PersistentEntity entity) |
EntityFetchOptions
(org.grails.datastore.mapping.model.PersistentEntity entity, java.lang.String projectionName) Designed for use when a projection query is used. |
Type Params | Return Type | Name and description |
---|---|---|
|
public java.util.Map<java.lang.String, org.grails.datastore.mapping.model.types.Association> |
getAssociations()
|
|
public java.util.Map<java.lang.String, java.util.Map> |
getFetchArgument(java.util.Set<java.lang.String> properties) Creates the fetch argument prepared to pass to grails.gorm.DetachedCriteria#list(Map) |
|
public java.util.Map<java.lang.String, java.util.Map> |
getFetchArgument(graphql.schema.DataFetchingEnvironment environment) |
|
public java.util.Map<java.lang.String, java.util.Map> |
getFetchArgument(graphql.schema.DataFetchingEnvironment environment, boolean skipCollections) Inspects the environment for requested fields and compares against the org.grails.datastore.mapping.model.PersistentEntity associations to determine which fields should be eagerly fetched. |
|
public java.util.Set<java.lang.String> |
getJoinProperties(java.util.List<graphql.language.Field> fields) |
|
public java.util.Set<java.lang.String> |
getJoinProperties(java.util.List<graphql.language.Field> fields, boolean skipCollections) Designed for internal use to inspect nested selections |
|
public java.util.Set<java.lang.String> |
getJoinProperties(graphql.schema.DataFetchingEnvironment environment) |
|
public java.util.Set<java.lang.String> |
getJoinProperties(graphql.schema.DataFetchingEnvironment environment, boolean skipCollections) Inspects the environment for requested fields and compares against the org.grails.datastore.mapping.model.PersistentEntity associations to determine which fields should be eagerly fetched. |
|
protected void |
handleField(java.lang.String parentName, Field selectedField, java.util.Set<java.lang.String> joinProperties) |
|
protected boolean |
isForeignKeyInChild(org.grails.datastore.mapping.model.types.Association association) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Designed for use when a projection query is used. The fetch arguments need prepended with the projection property name.
entity
- The org.grails.datastore.mapping.model.PersistentEntity being queriedprojectionName
- The name of the property being projected
Creates the fetch argument prepared to pass to grails.gorm.DetachedCriteria#list(Map)
properties
- The properties to fetchInspects the environment for requested fields and compares against the org.grails.datastore.mapping.model.PersistentEntity associations to determine which fields should be eagerly fetched. Creates the fetch argument prepared to pass to grails.gorm.DetachedCriteria#list(Map)
environment
- The fetching environmentskipCollections
- Whether to exclude associations that are collectionsDesigned for internal use to inspect nested selections
fields
- The list of fields to searchskipCollections
- Whether to exclude associations that are collectionsInspects the environment for requested fields and compares against the org.grails.datastore.mapping.model.PersistentEntity associations to determine which fields should be eagerly fetched.
environment
- The data fetching environmentskipCollections
- Whether to exclude associations that are collections