net.sf.jasperreports.engine.data

## Class JRHibernateAbstractDataSource

- java.lang.Object
- - net.sf.jasperreports.engine.data.JRHibernateAbstractDataSource

- All Implemented Interfaces:
    JRDataSource
  Direct Known Subclasses:
    JRHibernateIterateDataSource, JRHibernateListDataSource, JRHibernateScrollDataSource

      public abstract class JRHibernateAbstractDataSource
      extends java.lang.Object
      implements JRDataSource

  Base abstract Hibernate data source.
  Version:
    $Id: JRHibernateAbstractDataSource.java 6595 2013-10-17 14:36:41Z teodord $
  Author:
    Lucian Chirita (lucianc@users.sourceforge.net)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static interface` | `JRHibernateAbstractDataSource.FieldReader` Interface used to get the value of a report field from a result row.
    `protected static class` | `JRHibernateAbstractDataSource.IdentityFieldReader`
    `protected static class` | `JRHibernateAbstractDataSource.IndexFieldReader`
    `protected static class` | `JRHibernateAbstractDataSource.IndexPropertyFieldReader`
    `protected static class` | `JRHibernateAbstractDataSource.PropertyFieldReader`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected JRHibernateQueryExecuter` | `queryExecuter`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `JRHibernateAbstractDataSource(JRHibernateQueryExecuter queryExecuter, boolean useFieldDescription, boolean useIndexOnSingleReturn)` Creates a Hibernate data source.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.util.Map<java.lang.String,JRHibernateAbstractDataSource.FieldReader>` | `assignReaders(boolean useIndexOnSingleReturn)` Assigns field readers to report fields.
    `protected java.lang.String` | `getFieldMapping(JRField field)`
    `protected JRHibernateAbstractDataSource.FieldReader` | `getFieldReader(org.hibernate.type.Type[] returnTypes, java.util.Map<java.lang.String,java.lang.Integer> aliasesMap, JRField field)`
    `protected JRHibernateAbstractDataSource.FieldReader` | `getFieldReaderSingleReturn(java.util.Map<java.lang.String,java.lang.Integer> aliasesMap, JRField field, boolean useIndex)`
    `java.lang.Object` | `getFieldValue(JRField jrField)` Gets the field value for the current position.
    `protected void` | `setCurrentRowValue(java.lang.Object currentReturnValue)` Sets the current row of the query result.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface net.sf.jasperreports.engine.JRDataSource

      `next`

- - ### Field Detail

    - #### queryExecuter

          protected final JRHibernateQueryExecuter queryExecuter

  - ### Constructor Detail

    - #### JRHibernateAbstractDataSource

          protected JRHibernateAbstractDataSource(JRHibernateQueryExecuter queryExecuter,
                                       boolean useFieldDescription,
                                       boolean useIndexOnSingleReturn)

      Creates a Hibernate data source.
      Parameters:
        `queryExecuter` - the query executer
        `useFieldDescription` - whether to use field descriptions for fields to results mapping
        `useIndexOnSingleReturn` - whether to use indexed addressing even when the query has only one return column

  - ### Method Detail

    - #### assignReaders

          protected java.util.Map<java.lang.String,JRHibernateAbstractDataSource.FieldReader> assignReaders(boolean useIndexOnSingleReturn)

      Assigns field readers to report fields.
      Parameters:
        `useIndexOnSingleReturn` - whether to use indexed addressing even when the query has only one return column
      Returns:
        a report field name to field reader mapping
      See Also:
        `JRHibernateAbstractDataSource.FieldReader`

    - #### getFieldReaderSingleReturn

          protected JRHibernateAbstractDataSource.FieldReader getFieldReaderSingleReturn(java.util.Map<java.lang.String,java.lang.Integer> aliasesMap,
                                                                             JRField field,
                                                                             boolean useIndex)

    - #### getFieldReader

          protected JRHibernateAbstractDataSource.FieldReader getFieldReader(org.hibernate.type.Type[] returnTypes,
                                                                 java.util.Map<java.lang.String,java.lang.Integer> aliasesMap,
                                                                 JRField field)

    - #### setCurrentRowValue

          protected void setCurrentRowValue(java.lang.Object currentReturnValue)

      Sets the current row of the query result.
      Parameters:
        `currentReturnValue` - the current row value

    - #### getFieldValue

          public java.lang.Object getFieldValue(JRField jrField)
                                         throws JRException

      Description copied from interface: `JRDataSource`
      Gets the field value for the current position.
      Specified by:
        `getFieldValue` in interface `JRDataSource`
      Returns:
        an object containing the field value. The object type must be the field object type.
      Throws:
        `JRException`

    - #### getFieldMapping

          protected java.lang.String getFieldMapping(JRField field)

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com