FileDocCategorySizeDatePackage
HolderInstantiator.javaAPI DocHibernate 3.2.52263Thu Mar 16 07:14:48 GMT 2006org.hibernate.hql

HolderInstantiator

public final class HolderInstantiator extends Object
author
Gavin King

Fields Summary
public static final HolderInstantiator
NOOP_INSTANTIATOR
private final org.hibernate.transform.ResultTransformer
transformer
private final String[]
queryReturnAliases
Constructors Summary
public HolderInstantiator(org.hibernate.transform.ResultTransformer transformer, String[] queryReturnAliases)

		this.transformer = transformer;		
		this.queryReturnAliases = queryReturnAliases;
	
Methods Summary
public static org.hibernate.hql.HolderInstantiatorcreateClassicHolderInstantiator(java.lang.reflect.Constructor constructor, org.hibernate.transform.ResultTransformer transformer)

		if ( constructor != null ) {
			return new HolderInstantiator(new AliasToBeanConstructorResultTransformer(constructor), null);
		}
		else {
			return new HolderInstantiator(transformer, null);
		}
	
public static org.hibernate.transform.ResultTransformercreateSelectNewTransformer(java.lang.reflect.Constructor constructor, boolean returnMaps, boolean returnLists)

		if ( constructor != null ) {
			return new AliasToBeanConstructorResultTransformer(constructor);
		}
		else if ( returnMaps ) {
			return Transformers.ALIAS_TO_ENTITY_MAP;			
		}
		else if ( returnLists ) {
			return Transformers.TO_LIST;
		}		
		else {
			return null;
		}
	
public static org.hibernate.hql.HolderInstantiatorgetHolderInstantiator(org.hibernate.transform.ResultTransformer selectNewTransformer, org.hibernate.transform.ResultTransformer customTransformer, java.lang.String[] queryReturnAliases)

	
	         
		if(selectNewTransformer!=null) {
			return new HolderInstantiator(selectNewTransformer, queryReturnAliases);
		} else {
			return new HolderInstantiator(customTransformer, queryReturnAliases);
		}
	
public java.lang.String[]getQueryReturnAliases()

		return queryReturnAliases;
	
public org.hibernate.transform.ResultTransformergetResultTransformer()

		return transformer;
	
public java.lang.Objectinstantiate(java.lang.Object[] row)

		if(transformer==null) {
			return row;
		} else {
			return transformer.transformTuple(row, queryReturnAliases);
		}
	
public booleanisRequired()

		return transformer!=null;