shu.yi.eutech Posted February 10, 2015 Posted February 10, 2015 Hello everyone,I'm learning JasperReports' sample of ejbql-based data source. In the sample template I read this xml element: <queryString language="ejbql"> <![CDATA[sELECT m FROM Movie m WHERE m.releaseDate BETWEEN $P{DateFrom} AND $P{DateTo} ORDER BY $P!{OrderClause}]]> </queryString>It means that I should write the JPQL statement in the template. But this is not my use case.However in my project I need to build dynamic and criteria-based query with API like javax.persistence.criteria.CriteriaBuilder javax.persistence.criteria.CriteriaQuery, etc, instead of writing JPQL directly as plain text because I may have very different types of condition in where-clause for the same report.So how may I reference criteria query in JasperReports? Or do I have to retrieve underlying JDBC ResultSet and pass it as data source?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now