Package org.hibernate.transform
Class AliasToBeanConstructorResultTransformer
- java.lang.Object
-
- org.hibernate.transform.AliasToBeanConstructorResultTransformer
-
- All Implemented Interfaces:
java.io.Serializable,ResultTransformer
public class AliasToBeanConstructorResultTransformer extends java.lang.Object implements ResultTransformer
Wraps the tuples in a constructor call. todo : why Alias* in the name???- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AliasToBeanConstructorResultTransformer(java.lang.reflect.Constructor constructor)Instantiates a AliasToBeanConstructorResultTransformer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)2 AliasToBeanConstructorResultTransformer are considered equal if they have the same defined constructor.inthashCode()Define our hashCode by our defined constructor's hasCode.java.util.ListtransformList(java.util.List collection)Here we have an opportunity to perform transformation on the query result as a whole.java.lang.ObjecttransformTuple(java.lang.Object[] tuple, java.lang.String[] aliases)Wrap the incoming tuples in a call to our configured constructor.
-
-
-
Method Detail
-
transformTuple
public java.lang.Object transformTuple(java.lang.Object[] tuple, java.lang.String[] aliases)Wrap the incoming tuples in a call to our configured constructor.- Specified by:
transformTuplein interfaceResultTransformer- Parameters:
tuple- The result elementsaliases- The result aliases ("parallel" array to tuple)- Returns:
- The transformed row.
-
transformList
public java.util.List transformList(java.util.List collection)
Description copied from interface:ResultTransformerHere we have an opportunity to perform transformation on the query result as a whole. This might be useful to convert from one collection type to another or to remove duplicates from the result, etc.- Specified by:
transformListin interfaceResultTransformer- Parameters:
collection- The result.- Returns:
- The transformed result.
-
hashCode
public int hashCode()
Define our hashCode by our defined constructor's hasCode.- Overrides:
hashCodein classjava.lang.Object- Returns:
- Our defined ctor hashCode
-
equals
public boolean equals(java.lang.Object other)
2 AliasToBeanConstructorResultTransformer are considered equal if they have the same defined constructor.- Overrides:
equalsin classjava.lang.Object- Parameters:
other- The other instance to check for equality.- Returns:
- True if both have the same defined constructor; false otherwise.
-
-