Package net.sf.jasperreports.j2ee.ejbql
Class JRJpaDataSource
java.lang.Object
net.sf.jasperreports.engine.data.JRAbstractBeanDataSource
net.sf.jasperreports.j2ee.ejbql.JRJpaDataSource
- All Implemented Interfaces:
JRDataSource,JRRewindableDataSource
Java Persistence API data source that uses
javax.persistence.Query.getResultList().
The query result can be paginated by not retrieving all the rows at once.
Fields are mapped to values in the result following these rules:
- if the query returns a single object/bean (e.g.
SELECT m FROM Movie morSELECT NEW MovieDescription(m.title, m.genre) FROM Movie m), then the fields are mapped to bean property names. - if the query returns multiple objects per row (e.g.
SELECT m.title, m.gender FROM Movie m), the fields are mapped using the following syntax: COLUMN_index[.property], with the indexes starting from 1. Example mappings: COLUMN_1, COLUMN_2, COLUMN_2.title, COLUMN_2.movie.title.
- Author:
- Marcel Overdijk (marceloverdijk@hotmail.com)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceprotected classprotected classprotected classNested classes/interfaces inherited from class net.sf.jasperreports.engine.data.JRAbstractBeanDataSource
JRAbstractBeanDataSource.DefaultPropertyNameProvider, JRAbstractBeanDataSource.PropertyNameProvider -
Field Summary
FieldsFields inherited from class net.sf.jasperreports.engine.data.JRAbstractBeanDataSource
CURRENT_BEAN_MAPPING, EXCEPTION_MESSAGE_KEY_BEAN_FIELD_VALUE_NOT_RETRIEVED, PROPERTY_JAVABEAN_FIELD_PROPERTY, propertyNameProvider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidgetFieldValue(JRField field) protected JRJpaDataSource.FieldValueReadergetFieldValueReader(JRField field) voidbooleannext()Methods inherited from class net.sf.jasperreports.engine.data.JRAbstractBeanDataSource
getBeanProperty, getFieldValue, getPropertyName, isCurrentBeanMapping
-
Field Details
-
EXCEPTION_MESSAGE_KEY_INDEX_OUT_OF_BOUNDS
- See Also:
-
currentRow
-
-
Constructor Details
-
JRJpaDataSource
-
-
Method Details
-
fetchPage
protected void fetchPage() -
next
public boolean next() -
moveFirst
public void moveFirst() -
getFieldValue
- Throws:
JRException
-
getFieldValueReader
-