Package net.sf.jasperreports.hibernate
Class JRHibernateAbstractDataSource
java.lang.Object
net.sf.jasperreports.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 interface
Interface used to get the value of a report field from a result row.protected static class
protected static class
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
JRHibernateAbstractDataSource
(JRHibernateQueryExecuter queryExecuter, boolean useFieldDescription) Creates a Hibernate data source. -
Method Summary
Modifier and TypeMethodDescriptionprotected Map
<String, JRHibernateAbstractDataSource.FieldReader> assignReaders
(jakarta.persistence.Tuple result) Assigns field readers to report fields.fieldReader
(JRField jrField) protected String
getFieldMapping
(JRField field) getFieldReader
(List<jakarta.persistence.TupleElement<?>> elements, Map<String, Integer> aliasesMap, JRField field) getFieldReaderSingleReturn
(Map<String, Integer> aliasesMap, JRField field) getFieldValue
(JRField jrField) Gets the field value for the current position.protected boolean
isManagedType
(jakarta.persistence.TupleElement<?> element) protected void
setCurrentRowValue
(jakarta.persistence.Tuple 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 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) Creates a Hibernate data source.- Parameters:
queryExecuter
- the query executeruseFieldDescription
- whether to use field descriptions for fields to results mapping
-
-
Method Details
-
assignReaders
protected Map<String,JRHibernateAbstractDataSource.FieldReader> assignReaders(jakarta.persistence.Tuple result) Assigns field readers to report fields.- Returns:
- a report field name to field reader mapping
- See Also:
-
isManagedType
protected boolean isManagedType(jakarta.persistence.TupleElement<?> element) -
getFieldReaderSingleReturn
protected JRHibernateAbstractDataSource.FieldReader getFieldReaderSingleReturn(Map<String, Integer> aliasesMap, JRField field) -
getFieldReader
-
setCurrentRowValue
protected void setCurrentRowValue(jakarta.persistence.Tuple currentReturnValue) Sets the current row of the query result.- Parameters:
currentReturnValue
- the current row value
-
fieldReader
-
getFieldValue
Description copied from interface:JRDataSource
Gets the field value for the current position.- Specified by:
getFieldValue
in interfaceJRDataSource
- Returns:
- an object containing the field value. The object type must be the field object type.
- Throws:
JRException
-
getFieldMapping
-