Class DistinctListTransformer<T>

java.lang.Object
io.hypersistence.utils.hibernate.query.DistinctListTransformer<T>
All Implemented Interfaces:
org.hibernate.query.ResultListTransformer<T>

public class DistinctListTransformer<T> extends Object implements org.hibernate.query.ResultListTransformer<T>
The DistinctListTransformer removes duplicates from the List of elements that were transformed by the TupleTransformer.

This is similar to the DistinctResultTransformer that was available in Hibernate 5.

Since:
2.21.0
Author:
Vlad Mihalcea
  • Field Details

  • Constructor Details

    • DistinctListTransformer

      public DistinctListTransformer()
  • Method Details

    • transformList

      public List<T> transformList(List collection)
      Deduplicates the provided List.
      Specified by:
      transformList in interface org.hibernate.query.ResultListTransformer<T>
      Parameters:
      collection - collections to be deduplicated
      Returns:
      deduplicated List