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. 
 | 
includeInTransformtransformListclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waittransformListpublic AliasToBeanResultTransformer(Class resultClass)
public boolean isTransformedValueATupleElement(String[] aliases, int tupleLength)
TupleSubsetResultTransformeraliases - - the aliases that correspond to the tupletupleLength - - the number of elements in the tuplepublic Object transformTuple(Object[] tuple, String[] aliases)
ResultTransformertransformTuple in interface ResultTransformertransformTuple in class BasicTransformerAdaptertuple - The result elementsaliases - The result aliases ("parallel" array to tuple)Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.