Class AliasToBeanConstructorResultTransformer<T>

java.lang.Object
org.hibernate.transform.AliasToBeanConstructorResultTransformer<T>
All Implemented Interfaces:
TupleTransformer<T>, TypedTupleTransformer<T>

@Deprecated public class AliasToBeanConstructorResultTransformer<T> extends Object implements TypedTupleTransformer<T>
Deprecated.
Use dynamic instantiation instead, either directly in HQL/JPQL (select new MyClass(...) ...) or using a ConstructorResult
TupleTransformer which wraps the tuples in calls to a class constructor.
See Also:
  • Constructor Details

    • AliasToBeanConstructorResultTransformer

      public AliasToBeanConstructorResultTransformer(Constructor<T> constructor)
      Deprecated.
      Instantiates a AliasToBeanConstructorResultTransformer.
      Parameters:
      constructor - The constructor in which to wrap the tuples.
  • Method Details

    • forConstructor

      public static <T> TypedTupleTransformer<T> forConstructor(Constructor<T> constructor)
      Deprecated.
    • getTransformedType

      public Class<T> getTransformedType()
      Deprecated.
      Description copied from interface: TypedTupleTransformer
      The type resulting from this transformation
      Specified by:
      getTransformedType in interface TypedTupleTransformer<T>
    • transformTuple

      public T transformTuple(Object[] tuple, String[] aliases)
      Deprecated.
      Wrap the incoming tuples in a call to our configured constructor.
      Specified by:
      transformTuple in interface TupleTransformer<T>
      Parameters:
      tuple - The result elements
      aliases - The result aliases ("parallel" array to tuple)
      Returns:
      The transformed row.
    • hashCode

      public int hashCode()
      Deprecated.
      Define our hashCode by our defined constructor's hasCode.
      Overrides:
      hashCode in class Object
      Returns:
      Our defined ctor hashCode
    • equals

      public boolean equals(Object other)
      Deprecated.
      2 AliasToBeanConstructorResultTransformer are considered equal if they have the same defined constructor.
      Overrides:
      equals in class Object
      Parameters:
      other - The other instance to check for equality.
      Returns:
      True if both have the same defined constructor; false otherwise.