Class DefaultResolveNaturalIdEventListener

    • Constructor Detail

      • DefaultResolveNaturalIdEventListener

        public DefaultResolveNaturalIdEventListener()
    • Method Detail

      • resolveNaturalId

        protected Object resolveNaturalId​(ResolveNaturalIdEvent event)
        Coordinates the efforts to load a given entity. First, an attempt is made to load the entity from the session-level cache. If not found there, an attempt is made to locate it in second-level cache. Lastly, an attempt is made to load it directly from the datasource.
        Parameters:
        event - The load event
        Returns:
        The loaded entity, or null.
      • resolveFromCache

        protected Object resolveFromCache​(ResolveNaturalIdEvent event)
        Attempts to resolve the entity id corresponding to the event's natural id values from the session
        Parameters:
        event - The load event
        Returns:
        The entity from the cache, or null.
      • loadFromDatasource

        protected Object loadFromDatasource​(ResolveNaturalIdEvent event)
        Performs the process of loading an entity from the configured underlying datasource.
        Parameters:
        event - The load event
        Returns:
        The object loaded from the datasource, or null if not found.