Class CollectionHydrator

java.lang.Object
nl.datasteel.crudcraft.projection.impl.CollectionHydrator

public final class CollectionHydrator extends Object
Utility class that hydrates collection attributes for projection DTOs.
  • Method Details

    • hydrateCollections

      public static <T, D> void hydrateCollections(Class<T> entityType, ProjectionMetadata<D> metadata, Map<Object,D> dtoMap, CollectionHydrator.RowFetcher fetcher)
      Hydrates collection attributes in the DTO map by fetching the necessary data from the database.
      Parameters:
      entityType - the type of the entity being projected
      metadata - the projection metadata for the DTO type
      dtoMap - a map of IDs to DTO instances to hydrate
      fetcher - a function that fetches collection data for the given entity type