Class JRHibernateAbstractDataSource
java.lang.Object
net.sf.jasperreports.j2ee.hibernate.JRHibernateAbstractDataSource
- All Implemented Interfaces:
JRDataSource
- Direct Known Subclasses:
JRHibernateIterateDataSource,JRHibernateListDataSource,JRHibernateScrollDataSource
Base abstract Hibernate data source.
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceInterface used to get the value of a report field from a result row.protected static classprotected static classprotected static classprotected static class -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJRHibernateAbstractDataSource(JRHibernateQueryExecuter queryExecuter, boolean useFieldDescription, boolean useIndexOnSingleReturn) Creates a Hibernate data source. -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<String, JRHibernateAbstractDataSource.FieldReader> assignReaders(boolean useIndexOnSingleReturn) Assigns field readers to report fields.protected StringgetFieldMapping(JRField field) getFieldReader(org.hibernate.type.Type[] returnTypes, Map<String, Integer> aliasesMap, JRField field) getFieldReaderSingleReturn(Map<String, Integer> aliasesMap, JRField field, boolean useIndex) getFieldValue(JRField jrField) Gets the field value for the current position.protected voidsetCurrentRowValue(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, waitMethods inherited from interface net.sf.jasperreports.engine.JRDataSource
next
-
Field Details
-
EXCEPTION_MESSAGE_KEY_FIELD_ALIAS_TYPE_MISMATCH
- See Also:
-
EXCEPTION_MESSAGE_KEY_MANY_FIELDS_DETECTED
- See Also:
-
EXCEPTION_MESSAGE_KEY_NO_FIELD_ALIAS
- See Also:
-
EXCEPTION_MESSAGE_KEY_NO_FIELD_READER
- See Also:
-
EXCEPTION_MESSAGE_KEY_UNKNOWN_RETURN_ALIAS
- See Also:
-
queryExecuter
-
-
Constructor Details
-
JRHibernateAbstractDataSource
protected JRHibernateAbstractDataSource(JRHibernateQueryExecuter queryExecuter, boolean useFieldDescription, boolean useIndexOnSingleReturn) Creates a Hibernate data source.- Parameters:
queryExecuter- the query executeruseFieldDescription- whether to use field descriptions for fields to results mappinguseIndexOnSingleReturn- whether to use indexed addressing even when the query has only one return column
-
-
Method Details
-
assignReaders
protected Map<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:
-
getFieldReaderSingleReturn
protected JRHibernateAbstractDataSource.FieldReader getFieldReaderSingleReturn(Map<String, Integer> aliasesMap, JRField field, boolean useIndex) -
getFieldReader
protected JRHibernateAbstractDataSource.FieldReader getFieldReader(org.hibernate.type.Type[] returnTypes, Map<String, Integer> aliasesMap, JRField field) -
setCurrentRowValue
Sets the current row of the query result.- Parameters:
currentReturnValue- the current row value
-
getFieldValue
Description copied from interface:JRDataSourceGets the field value for the current position.- Specified by:
getFieldValuein interfaceJRDataSource- Returns:
- an object containing the field value. The object type must be the field object type.
- Throws:
JRException
-
getFieldMapping
-