Record Class CollectionHydrator.FetchResult

java.lang.Object
java.lang.Record
nl.datasteel.crudcraft.projection.impl.CollectionHydrator.FetchResult
Enclosing class:
CollectionHydrator

public static record CollectionHydrator.FetchResult(List<Object[]> rows, List<Class<?>> joinTypes) extends Record
Result returned by the CollectionHydrator.RowFetcher containing the fetched rows and the Java types of the joined associations.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FetchResult(List<Object[]> rows, List<Class<?>> joinTypes)
    Constructs a new FetchResult with the given rows and join types.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the Java types of the joined associations as an immutable list.
    Returns the fetched rows as an immutable list.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FetchResult

      public FetchResult(List<Object[]> rows, List<Class<?>> joinTypes)
      Constructs a new FetchResult with the given rows and join types. The lists are copied to ensure immutability.
      Parameters:
      rows - the fetched rows, where each row is an array of objects
      joinTypes - the Java types of the joined associations
  • Method Details

    • rows

      public List<Object[]> rows()
      Returns the fetched rows as an immutable list. Each row is represented as an array of objects.
      Returns:
      an immutable list of rows
    • joinTypes

      public List<Class<?>> joinTypes()
      Returns the Java types of the joined associations as an immutable list. This is useful for determining the types of nested DTOs that need to be hydrated recursively.
      Returns:
      an immutable list of join types
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.