public class CacheableResultTransformer extends java.lang.Object implements ResultTransformer
Modifier and Type | Method and Description |
---|---|
static CacheableResultTransformer |
create(ResultTransformer transformer,
java.lang.String[] aliases,
boolean[] includeInTuple)
Returns a CacheableResultTransformer that is used to transform
tuples to a value(s) that can be cached.
|
boolean |
equals(java.lang.Object o) |
Type[] |
getCachedResultTypes(Type[] tupleResultTypes) |
int |
hashCode() |
java.util.List |
retransformResults(java.util.List transformedResults,
java.lang.String[] aliases,
ResultTransformer transformer,
boolean[] includeInTuple)
Re-transforms, if necessary, a List of values previously
transformed by this (or an equivalent) CacheableResultTransformer.
|
java.util.List |
transformList(java.util.List list)
Here we have an opportunity to perform transformation on the
query result as a whole.
|
java.lang.Object |
transformTuple(java.lang.Object[] tuple,
java.lang.String[] aliases)
Tuples are the elements making up each "row" of the query result.
|
java.util.List |
untransformToTuples(java.util.List results)
Untransforms, if necessary, a List of values previously
transformed by this (or an equivalent) CacheableResultTransformer.
|
public static CacheableResultTransformer create(ResultTransformer transformer, java.lang.String[] aliases, boolean[] includeInTuple)
transformer
- - result transformer that will ultimately be
be used (after caching results)aliases
- - the aliases that correspond to the tuple;
if it is non-null, its length must equal the number
of true elements in includeInTuple[]includeInTuple
- - array with the i-th element indicating
whether the i-th expression returned by a query is
included in the tuple; the number of true values equals
the length of the tuple that will be transformed;
must be non-nullpublic java.lang.Object transformTuple(java.lang.Object[] tuple, java.lang.String[] aliases)
ResultTransformer
transformTuple
in interface ResultTransformer
tuple
- The result elementsaliases
- The result aliases ("parallel" array to tuple)public java.util.List retransformResults(java.util.List transformedResults, java.lang.String[] aliases, ResultTransformer transformer, boolean[] includeInTuple)
transformedResults
- - results that were previously transformedaliases
- - the aliases that correspond to the untransformed tuple;transformer
- - the transformer for the re-transformationincludeInTuple
- indicates the indexes ofpublic java.util.List untransformToTuples(java.util.List results)
results
- - results that were previously transformedpublic java.util.List transformList(java.util.List list)
ResultTransformer
transformList
in interface ResultTransformer
list
- The result.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.