public class DistinctRootEntityResultTransformer extends Object implements TupleSubsetResultTransformer
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
.Modifier and Type | Field and Description |
---|---|
static DistinctRootEntityResultTransformer |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
boolean[] |
includeInTransform(String[] aliases,
int tupleLength)
Returns an array with the i-th element indicating whether the i-th
element of the tuple is included in the transformed value.
|
boolean |
isTransformedValueATupleElement(String[] aliases,
int tupleLength)
When a tuple is transformed, is the result a single element of the tuple?
|
List |
transformList(List list)
Simply delegates to
DistinctResultTransformer.transformList(java.util.List) . |
Object |
transformTuple(Object[] tuple,
String[] aliases)
Simply delegates to
RootEntityResultTransformer.transformTuple(java.lang.Object[], java.lang.String[]) . |
public static final DistinctRootEntityResultTransformer INSTANCE
public Object transformTuple(Object[] tuple, String[] aliases)
RootEntityResultTransformer.transformTuple(java.lang.Object[], java.lang.String[])
.transformTuple
in interface ResultTransformer
tuple
- The tuple to transformaliases
- The tuple aliasespublic List transformList(List list)
DistinctResultTransformer.transformList(java.util.List)
.transformList
in interface ResultTransformer
list
- The list to transform.public boolean[] includeInTransform(String[] aliases, int tupleLength)
TupleSubsetResultTransformer
includeInTransform
in interface TupleSubsetResultTransformer
aliases
- - the aliases that correspond to the tupletupleLength
- - the number of elements in the tuplepublic boolean isTransformedValueATupleElement(String[] aliases, int tupleLength)
TupleSubsetResultTransformer
isTransformedValueATupleElement
in interface TupleSubsetResultTransformer
aliases
- - the aliases that correspond to the tupletupleLength
- - the number of elements in the tupleCopyright © 2001-2015 Red Hat, Inc. All Rights Reserved.