Top Description Fields Constructors Methods
org.hibernate.transform

public Class AliasToBeanConstructorResultTransformer

extends Object
implements ResultTransformer
Class Inheritance
All Implemented Interfaces
org.hibernate.transform.ResultTransformer, java.io.Serializable
Imports
java.lang.reflect.Constructor, java.util.List, org.hibernate.QueryException

Wraps the tuples in a constructor call. todo : why Alias* in the name???

Field Summary

Modifier and TypeField and Description
private final Constructor<T>

Constructor Summary

AccessConstructor and Description
public
AliasToBeanConstructorResultTransformer(Constructor<T>
The contructor in which to wrap the tuples.
constructor
)

Instantiates a AliasToBeanConstructorResultTransformer.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

True if both have the same defined constuctor; false otherwise.
equals
(Object
The other instance to check for equality.
other
)

Overrides java.lang.Object.equals.

2 AliasToBeanConstructorResultTransformer are considered equal if they have the same defined constructor.
public int

Returns:

Our defined ctor hashCode
hashCode
()

Overrides java.lang.Object.hashCode.

Define our hashCode by our defined constructor's hasCode.
public List<E>
transformList(List<E>
The result.
collection
)

Implements org.hibernate.transform.ResultTransformer.transformList.

Here we have an opportunity to perform transformation on the query result as a whole.
public Object
transformTuple(Object[]
The result elements
tuple
,
String[]
The result aliases ("parallel" array to tuple)
aliases
)

Implements org.hibernate.transform.ResultTransformer.transformTuple.

Wrap the incoming tuples in a call to our configured constructor.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

constructorback to summary
private final Constructor<T> constructor

Constructor Detail

AliasToBeanConstructorResultTransformerback to summary
public AliasToBeanConstructorResultTransformer(Constructor<T> constructor)

Instantiates a AliasToBeanConstructorResultTransformer.

Parameters
constructor:Constructor<T>

The contructor in which to wrap the tuples.

Method Detail

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

2 AliasToBeanConstructorResultTransformer are considered equal if they have the same defined constructor.

Parameters
other:Object

The other instance to check for equality.

Returns:boolean

True if both have the same defined constuctor; false otherwise.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Define our hashCode by our defined constructor's hasCode.

Returns:int

Our defined ctor hashCode

transformListback to summary
public List<E> transformList(List<E> collection)

Implements org.hibernate.transform.ResultTransformer.transformList.

Doc from org.hibernate.transform.ResultTransformer.transformList.

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.

Parameters
collection:List<E>

The result.

Returns:List<E>

The transformed result.

transformTupleback to summary
public Object transformTuple(Object[] tuple, String[] aliases)

Implements org.hibernate.transform.ResultTransformer.transformTuple.

Wrap the incoming tuples in a call to our configured constructor.

Parameters
tuple:Object[]

Doc from org.hibernate.transform.ResultTransformer.transformTuple.

The result elements

aliases:String[]

Doc from org.hibernate.transform.ResultTransformer.transformTuple.

The result aliases ("parallel" array to tuple)

Returns:Object

Doc from org.hibernate.transform.ResultTransformer.transformTuple.

The transformed row.