com.gisgraphy.hibernate.projection
Class ProjectionBean

java.lang.Object
  extended by org.hibernate.criterion.ProjectionList
      extended by com.gisgraphy.hibernate.projection.ProjectionBean
All Implemented Interfaces:
java.io.Serializable, org.hibernate.criterion.Projection

public class ProjectionBean
extends org.hibernate.criterion.ProjectionList

Author:
David Masclet
See Also:
Serialized Form

Constructor Summary
ProjectionBean(java.util.List<java.lang.String> fields, boolean autoAliasing)
           
 
Method Summary
static org.hibernate.criterion.ProjectionList beanFieldList(java.lang.Class<?> clazz, java.lang.String[] ignoreFields, boolean autoaliasing)
           
static org.hibernate.criterion.ProjectionList fieldList(java.util.List<java.lang.String> fieldList, boolean autoaliasing)
           
 
Methods inherited from class org.hibernate.criterion.ProjectionList
add, add, create, getAliases, getColumnAliases, getColumnAliases, getLength, getProjection, getTypes, getTypes, isGrouped, toGroupSqlString, toSqlString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProjectionBean

public ProjectionBean(java.util.List<java.lang.String> fields,
                      boolean autoAliasing)
Parameters:
fields - the list of the field names
autoAliasing - if the fields should be autoaliased. See important note above
Method Detail

fieldList

public static org.hibernate.criterion.ProjectionList fieldList(java.util.List<java.lang.String> fieldList,
                                                               boolean autoaliasing)
Parameters:
fieldList - a list of fields to retrieve Important Note : the projection are automatically aliased with the same name, you could have some problems when using restriction (column yX_ doesn't exists) see http://opensource.atlassian.com/projects/hibernate/browse/HHH-817. To avoid this problem you could disable aliasing .
activate auto-aliasing if you want to use aliasToBean Transformers. disable auto-aliasing if you want to add a restriction on a field that is in the fields list
Returns:
a new ProjectionList

beanFieldList

public static org.hibernate.criterion.ProjectionList beanFieldList(java.lang.Class<?> clazz,
                                                                   java.lang.String[] ignoreFields,
                                                                   boolean autoaliasing)
Parameters:
clazz - the class to inspect to retrieve the fields
ignoreFields - an array of fields that should be ignore
autoaliasing - if the fields should be auto-aliased See important note above
Returns:
a new ProjectionList


Copyright © 2010. All Rights Reserved.