public class AliasToBeanResultTransformer extends Object implements ResultTransformer, Serializable
List resultWithAliasedBean = s.createCriteria(Enrolment.class) .createAlias("student", "st") .createAlias("course", "co") .setProjection( Projections.projectionList() .add( Projections.property("co.description"), "courseDescription" ) ) .setResultTransformer( new AliasToBeanResultTransformer(StudentDTO.class) ) .list(); StudentDTO dto = (StudentDTO)resultWithAliasedBean.get(0);
Constructor and Description |
---|
AliasToBeanResultTransformer(Class resultClass) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
List |
transformList(List collection)
Here we have an opportunity to perform transformation on the
query result as a whole.
|
Object |
transformTuple(Object[] tuple,
String[] aliases)
Tuples are the elements making up each "row" of the query result.
|
public AliasToBeanResultTransformer(Class resultClass)
public Object transformTuple(Object[] tuple, String[] aliases)
ResultTransformer
transformTuple
in interface ResultTransformer
tuple
- The result elementsaliases
- The result aliases ("parallel" array to tuple)public List transformList(List collection)
ResultTransformer
transformList
in interface ResultTransformer
collection
- The result.Copyright © 2002-2017 Red Hat Middleware, LLC. All Rights Reserved