public static List<GisFeatureDistance> transformToGisFeatureDistance(String aliasList[],List<?> resultList,Map<Long,Set<String>> featureIdToZipCodesMap,Class clazz){
  List<GisFeatureDistance> results=new ArrayList<GisFeatureDistance>();
  if (aliasList != null && !resultList.isEmpty()) {
    ResultTransformer tr=new AliasToBeanResultTransformer(GisFeatureDistance.class);
    Iterator<?> it=resultList.iterator();
    Object[] obj;
    GisFeatureDistance gisFeatureDistance;
    while (it.hasNext()) {
      obj=(Object[])it.next();
      gisFeatureDistance=(GisFeatureDistance)tr.transformTuple(obj,aliasList);
      int indexInList=results.indexOf(gisFeatureDistance);
      if (indexInList == -1) {
        gisFeatureDistanceFactory.updateFields(gisFeatureDistance,clazz);
        results.add(gisFeatureDistance);
        if (featureIdToZipCodesMap != null) {
          gisFeatureDistance.setZipCodes(featureIdToZipCodesMap.get(gisFeatureDistance.getId()));
        }
      }
    }
  }
  return results;
}

public static List < GisFeatureDistance > transformToGisFeatureDistance ( String aliasList [ ] , List < ? > resultList , Map < Long , Set < String > > featureIdToZipCodesMap , Class clazz ) { List < GisFeatureDistance > results = new ArrayList < GisFeatureDistance > ( ) ; if ( aliasList != null && ! resultList . isEmpty ( ) ) { ResultTransformer tr = new AliasToBeanResultTransformer ( GisFeatureDistance . class ) ; Iterator < ? > it = resultList . iterator ( ) ; Object [ ] obj ; GisFeatureDistance gisFeatureDistance ; while ( it . hasNext ( ) ) { obj = ( Object [ ] ) it . next ( ) ; gisFeatureDistance = ( GisFeatureDistance ) tr . transformTuple ( obj , aliasList ) ; int indexInList = results . indexOf ( gisFeatureDistance ) ; if ( indexInList == - 1 ) { gisFeatureDistanceFactory . updateFields ( gisFeatureDistance , clazz ) ; results . add ( gisFeatureDistance ) ; if ( featureIdToZipCodesMap != null ) { gisFeatureDistance . setZipCodes ( featureIdToZipCodesMap . get ( gisFeatureDistance . getId ( ) ) ) ; } } } } return results ; }
transform to bean . see bug http : / / opensource . atlassian . com / projects / hibernate / browse / hhh - 2463
