类 CacheableResultTransformer
- java.lang.Object
-
- org.hibernate.transform.CacheableResultTransformer
-
- 所有已实现的接口:
Serializable,ResultTransformer
public class CacheableResultTransformer extends Object implements ResultTransformer
A ResultTransformer that is used to transform tuples to a value(s) that can be cached.- 作者:
- Gail Badner
- 另请参阅:
- 序列化表格
-
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static CacheableResultTransformercreate(ResultTransformer transformer, String[] aliases, boolean[] includeInTuple)Returns a CacheableResultTransformer that is used to transform tuples to a value(s) that can be cached.booleanequals(Object o)Type[]getCachedResultTypes(Type[] tupleResultTypes)inthashCode()ListretransformResults(List transformedResults, String[] aliases, ResultTransformer transformer, boolean[] includeInTuple)Re-transforms, if necessary, a List of values previously transformed by this (or an equivalent) CacheableResultTransformer.ListtransformList(List list)Here we have an opportunity to perform transformation on the query result as a whole.ObjecttransformTuple(Object[] tuple, String[] aliases)Tuples are the elements making up each "row" of the query result.ListuntransformToTuples(List results)Untransforms, if necessary, a List of values previously transformed by this (or an equivalent) CacheableResultTransformer.
-
-
-
方法详细资料
-
create
public static CacheableResultTransformer create(ResultTransformer transformer, String[] aliases, boolean[] includeInTuple)
Returns a CacheableResultTransformer that is used to transform tuples to a value(s) that can be cached.- 参数:
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-null- 返回:
- a CacheableResultTransformer that is used to transform tuples to a value(s) that can be cached.
-
transformTuple
public Object transformTuple(Object[] tuple, String[] aliases)
从接口复制的说明:ResultTransformerTuples are the elements making up each "row" of the query result. The contract here is to transform these elements into the final row.- 指定者:
transformTuple在接口中ResultTransformer- 参数:
tuple- The result elementsaliases- The result aliases ("parallel" array to tuple)- 返回:
- The transformed row.
-
retransformResults
public List retransformResults(List transformedResults, String[] aliases, ResultTransformer transformer, boolean[] includeInTuple)
Re-transforms, if necessary, a List of values previously transformed by this (or an equivalent) CacheableResultTransformer. Each element of the list is re-transformed in place (i.e, List elements are replaced with re-transformed values) and the original List is returned. If re-transformation is unnecessary, the original List is returned unchanged.- 参数:
transformedResults- - results that were previously transformedaliases- - the aliases that correspond to the untransformed tuple;transformer- - the transformer for the re-transformationincludeInTuple- indicates the indexes of- 返回:
- transformedResults, with each element re-transformed (if necessary)
-
untransformToTuples
public List untransformToTuples(List results)
Untransforms, if necessary, a List of values previously transformed by this (or an equivalent) CacheableResultTransformer. Each element of the list is untransformed in place (i.e, List elements are replaced with untransformed values) and the original List is returned. If not unnecessary, the original List is returned unchanged. NOTE: If transformed values are a subset of the original tuple, then, on return, elements corresponding to excluded tuple elements will be null.- 参数:
results- - results that were previously transformed- 返回:
- results, with each element untransformed (if necessary)
-
transformList
public List transformList(List list)
从接口复制的说明:ResultTransformerHere 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.- 指定者:
transformList在接口中ResultTransformer- 参数:
list- The result.- 返回:
- The transformed result.
-
-