public class AliasToBeanResultTransformer extends AliasedTupleSubsetResultTransformer
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() |
boolean |
isTransformedValueATupleElement(String[] aliases,
int tupleLength)
When a tuple is transformed, is the result a single element of the tuple?
|
Object |
transformTuple(Object[] tuple,
String[] aliases)
Tuples are the elements making up each "row" of the query result.
|
includeInTransform
transformList
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
transformList
public AliasToBeanResultTransformer(Class resultClass)
public boolean isTransformedValueATupleElement(String[] aliases, int tupleLength)
TupleSubsetResultTransformer
aliases
- - the aliases that correspond to the tupletupleLength
- - the number of elements in the tuplepublic Object transformTuple(Object[] tuple, String[] aliases)
ResultTransformer
transformTuple
in interface ResultTransformer
transformTuple
in class BasicTransformerAdapter
tuple
- The result elementsaliases
- The result aliases ("parallel" array to tuple)Copyright © 2019 JBoss by Red Hat. All rights reserved.