org.hibernate.transform

Class RootEntityResultTransformer

Implemented Interfaces:
Serializable, ResultTransformer

public final class RootEntityResultTransformer
extends BasicTransformerAdapter
implements Serializable

ResultTransformer implementation which limits the result tuple to only the "root entity".

Since this transformer is stateless, all instances would be considered equal. So for optimization purposes we limit it to a single, singleton instance.

Authors:
Gavin King
Steve Ebersole

Field Summary

static RootEntityResultTransformer
INSTANCE

Constructor Summary

RootEntityResultTransformer()
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()
Object
transformTuple(Object[] tuple, String[] aliases)
Return just the root entity from the row tuple.

Methods inherited from class org.hibernate.transform.BasicTransformerAdapter

transformList, transformTuple

Field Details

INSTANCE

public static final RootEntityResultTransformer INSTANCE

Constructor Details

RootEntityResultTransformer

public RootEntityResultTransformer()

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

Instantiate RootEntityResultTransformer.

Method Details

equals

public boolean equals(Object other)

hashCode

public int hashCode()

transformTuple

public Object transformTuple(Object[] tuple,
                             String[] aliases)
Return just the root entity from the row tuple.
Specified by:
transformTuple in interface ResultTransformer
Overrides:
transformTuple in interface BasicTransformerAdapter