FileDocCategorySizeDatePackage
DistinctRootEntityResultTransformer.javaAPI DocHibernate 3.2.51353Thu Jun 03 11:31:32 BST 2004org.hibernate.transform

DistinctRootEntityResultTransformer

public class DistinctRootEntityResultTransformer extends Object implements ResultTransformer
author
Gavin King

Fields Summary
private static final Log
log
Constructors Summary
Methods Summary
public java.util.ListtransformList(java.util.List list)

		List result = new ArrayList( list.size() );
		Set distinct = new HashSet();
		for ( int i=0; i<list.size(); i++ ) {
			Object entity = list.get(i);
			if ( distinct.add( new Identity(entity) ) ) {
				result.add(entity);
			}
		}
		if ( log.isDebugEnabled() ) log.debug(
			"transformed: " +
			list.size() + " rows to: " +
			result.size() + " distinct results"
		);
		return result;
	
public java.lang.ObjecttransformTuple(java.lang.Object[] tuple, java.lang.String[] aliases)

		return tuple[ tuple.length-1 ];