Package org.hibernate.transform
Class AliasToBeanConstructorResultTransformer
- java.lang.Object
-
- org.hibernate.transform.AliasToBeanConstructorResultTransformer
-
- All Implemented Interfaces:
Serializable
,ResultTransformer
public class AliasToBeanConstructorResultTransformer extends 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(Constructor constructor)
Instantiates a AliasToBeanConstructorResultTransformer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
2 AliasToBeanConstructorResultTransformer are considered equal if they have the same defined constructor.int
hashCode()
Define our hashCode by our defined constructor's hasCode.List
transformList(List collection)
Here we have an opportunity to perform transformation on the query result as a whole.Object
transformTuple(Object[] tuple, String[] aliases)
Wrap the incoming tuples in a call to our configured constructor.
-
-
-
Constructor Detail
-
AliasToBeanConstructorResultTransformer
public AliasToBeanConstructorResultTransformer(Constructor constructor)
Instantiates a AliasToBeanConstructorResultTransformer.- Parameters:
constructor
- The contructor in which to wrap the tuples.
-
-
Method Detail
-
transformTuple
public Object transformTuple(Object[] tuple, String[] aliases)
Wrap the incoming tuples in a call to our configured constructor.- Specified by:
transformTuple
in interfaceResultTransformer
- Parameters:
tuple
- The result elementsaliases
- The result aliases ("parallel" array to tuple)- Returns:
- The transformed row.
-
transformList
public List transformList(List collection)
Description copied from interface:ResultTransformer
Here 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:
transformList
in interfaceResultTransformer
- Parameters:
collection
- The result.- Returns:
- The transformed result.
-
hashCode
public int hashCode()
Define our hashCode by our defined constructor's hasCode.
-
equals
public boolean equals(Object other)
2 AliasToBeanConstructorResultTransformer are considered equal if they have the same defined constructor.
-
-