com.gisgraphy.hibernate.projection

## Class ProjectionBean

- java.lang.Object
- - org.hibernate.criterion.ProjectionList
  - - com.gisgraphy.hibernate.projection.ProjectionBean

- All Implemented Interfaces:
    Serializable, org.hibernate.criterion.Projection

      public class ProjectionBean
      extends org.hibernate.criterion.ProjectionList

  Author:
    David Masclet
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProjectionBean(List<String> fields, boolean autoAliasing)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static org.hibernate.criterion.ProjectionList` | `beanFieldList(Class<?> clazz, String[] ignoreFields, boolean autoaliasing)`
    `static org.hibernate.criterion.ProjectionList` | `fieldList(List<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(List<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(List<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(Class<?> clazz,
                                                             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 © 2015. All rights reserved.