org.hibernate.transform

Class DistinctRootEntityResultTransformer

Implemented Interfaces:
ResultTransformer, Serializable

public class DistinctRootEntityResultTransformer
extends java.lang.Object
implements ResultTransformer, Serializable

Much like RootEntityResultTransformer, but we also distinct the entity in the final result.

Since this transformer is stateless, all instances would be considered equal. So for optimization purposes we limit it to a single, singleton instance (this is not quite true yet: see deprecation notice on constructor).

Authors:
Gavin King
Steve Ebersole

Field Summary

static DistinctRootEntityResultTransformer
INSTANCE

Constructor Summary

DistinctRootEntityResultTransformer()
Deprecated. Use the INSTANCE reference instead of explicitly creating a new one (to be removed in 3.4).

Method Summary

boolean
equals(Object other)
int
hashCode()
List
transformList(List list)
Simply delegates to DistinctResultTransformer.transformList(List).
Object
transformTuple(Object[] tuple, String[] aliases)
Simply delegates to RootEntityResultTransformer.transformTuple(Object[],String[]).

Field Details

INSTANCE

public static final DistinctRootEntityResultTransformer INSTANCE

Constructor Details

DistinctRootEntityResultTransformer

public DistinctRootEntityResultTransformer()

Deprecated. Use the INSTANCE reference instead of explicitly creating a new one (to be removed in 3.4).

Instantiate a DistinctRootEntityResultTransformer.

todo : make private, see deprecation notice

Method Details

equals

public boolean equals(Object other)

hashCode

public int hashCode()

transformList

public List transformList(List list)
Specified by:
transformList in interface ResultTransformer
Parameters:
list - The list to transform.
Returns:
The transformed List.

transformTuple

public Object transformTuple(Object[] tuple,
                             String[] aliases)
Specified by:
transformTuple in interface ResultTransformer
Parameters:
tuple - The tuple to transform
aliases - The tuple aliases
Returns:
The transformed tuple row.