public class JRJpaDataSource extends JRAbstractBeanDataSource
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:
SELECT m FROM Movie m or
SELECT NEW MovieDescription(m.title, m.genre) FROM Movie m), then the fields are
mapped to bean property names.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.JRJpaQueryExecuterFactory.PROPERTY_JPA_QUERY_PAGE_SIZE| Modifier and Type | Class and Description |
|---|---|
protected static interface |
JRJpaDataSource.FieldValueReader |
protected class |
JRJpaDataSource.IndexPropertyReader |
protected class |
JRJpaDataSource.IndexReader |
protected class |
JRJpaDataSource.PropertyReader |
| Modifier and Type | Field and Description |
|---|---|
protected Object |
currentRow |
CURRENT_BEAN_MAPPING, FIELD_DESCRIPTION_PROPERTY_NAME_PROVIDER, FIELD_NAME_PROPERTY_NAME_PROVIDER, propertyNameProvider| Constructor and Description |
|---|
JRJpaDataSource(JRJpaQueryExecuter queryExecuter,
int pageSize) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
fetchPage() |
Object |
getFieldValue(JRField field)
Gets the field value for the current position.
|
protected JRJpaDataSource.FieldValueReader |
getFieldValueReader(JRField field) |
void |
moveFirst()
Moves back to the first element in the data source.
|
boolean |
next()
Tries to position the cursor on the next element in the data source.
|
getBeanProperty, getFieldValue, getPropertyName, isCurrentBeanMappingprotected Object currentRow
public JRJpaDataSource(JRJpaQueryExecuter queryExecuter, int pageSize)
protected void fetchPage()
public boolean next()
JRDataSourcepublic void moveFirst()
JRRewindableDataSourcepublic Object getFieldValue(JRField field) throws JRException
JRDataSourceJRExceptionprotected JRJpaDataSource.FieldValueReader getFieldValueReader(JRField field)
Copyright © 2015. All rights reserved.