Class EntityGraphProviderImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.Class<?>,​EntityGraph> asMap​(boolean forWriter)
      Return an unmodifiable map of entity graphs for reader/writer.
      boolean containsEntityGraph​(java.lang.Class<?> entityClass, boolean forWriter)
      Determine whether an entity graph for given entity class has been created by this provider.
      ObjectGraph createObjectGraph​(java.lang.Class<?> entityClass, java.util.Set<java.lang.String> filteringScopes, boolean forWriter)
      Create an ObjectGraph for given parameters.
      EntityGraph getOrCreateEmptyEntityGraph​(java.lang.Class<?> entityClass, boolean forWriter)
      Get an empty entity graph for given class.
      EntityGraph getOrCreateEntityGraph​(java.lang.Class<?> entityClass, boolean forWriter)
      Get an entity graph for given class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • writerClassToGraph

        private final java.util.concurrent.ConcurrentMap<java.lang.Class<?>,​EntityGraph> writerClassToGraph
      • readerClassToGraph

        private final java.util.concurrent.ConcurrentMap<java.lang.Class<?>,​EntityGraph> readerClassToGraph
    • Constructor Detail

      • EntityGraphProviderImpl

        EntityGraphProviderImpl()
    • Method Detail

      • getOrCreateEntityGraph

        public EntityGraph getOrCreateEntityGraph​(java.lang.Class<?> entityClass,
                                                  boolean forWriter)
        Description copied from interface: EntityGraphProvider
        Get an entity graph for given class. New graph is created if no graph exists for given class.
        Specified by:
        getOrCreateEntityGraph in interface EntityGraphProvider
        Parameters:
        entityClass - entity class the graph should be created for.
        forWriter - flag determining whether the graph should be created for writer/reader.
        Returns:
        an entity graph.
      • getOrCreateEmptyEntityGraph

        public EntityGraph getOrCreateEmptyEntityGraph​(java.lang.Class<?> entityClass,
                                                       boolean forWriter)
        Description copied from interface: EntityGraphProvider
        Get an empty entity graph for given class. New graph is created if the stored one is not an empty entity graph or no graph exists for given class. This method overrides the graph created by EntityGraphProvider.getOrCreateEntityGraph(Class, boolean) method.
        Specified by:
        getOrCreateEmptyEntityGraph in interface EntityGraphProvider
        Parameters:
        entityClass - entity class the graph should be created for.
        forWriter - flag determining whether the graph should be created for writer/reader.
        Returns:
        an empty entity graph.
      • asMap

        public java.util.Map<java.lang.Class<?>,​EntityGraph> asMap​(boolean forWriter)
        Return an unmodifiable map of entity graphs for reader/writer.
        Parameters:
        forWriter - flag determining whether the returned map should be for writer/reader.
        Returns:
        an unmodifiable map of entity graphs.
      • containsEntityGraph

        public boolean containsEntityGraph​(java.lang.Class<?> entityClass,
                                           boolean forWriter)
        Description copied from interface: EntityGraphProvider
        Determine whether an entity graph for given entity class has been created by this provider.
        Specified by:
        containsEntityGraph in interface EntityGraphProvider
        Parameters:
        entityClass - entity class for which the graph should be checked.
        forWriter - flag determining whether the check should be in writer/reader graphs.
        Returns:
        true if the entity graph already exists, false otherwise.
      • createObjectGraph

        public ObjectGraph createObjectGraph​(java.lang.Class<?> entityClass,
                                             java.util.Set<java.lang.String> filteringScopes,
                                             boolean forWriter)
        Description copied from interface: EntityGraphProvider
        Create an ObjectGraph for given parameters. Every time this method is called a new instance of object graph is created.
        Specified by:
        createObjectGraph in interface EntityGraphProvider
        Parameters:
        entityClass - entity class which the object graph should be created for.
        filteringScopes - entity-filtering scopes the graph should be created for.
        forWriter - flag determining whether the graph should be created for writer/reader.
        Returns:
        an entity-filtering object graph instance.