1 28 package net.sf.jasperreports.engine.query; 29 30 import java.util.Map ; 31 32 import javax.persistence.EntityManager; 33 34 import net.sf.jasperreports.engine.JRDataset; 35 import net.sf.jasperreports.engine.JRException; 36 import net.sf.jasperreports.engine.util.JRProperties; 37 38 47 public class JRJpaQueryExecuterFactory implements JRQueryExecuterFactory { 48 49 52 public static final String QUERY_LANGUAGE_EJBQL = "ejbql"; 53 54 57 public static final String PARAMETER_JPA_ENTITY_MANAGER = "JPA_ENTITY_MANAGER"; 58 59 63 public static final String PARAMETER_JPA_QUERY_HINTS_MAP = "JPA_QUERY_HINTS_MAP"; 64 65 66 private static final Object [] JPA_BUILTIN_PARAMETERS = { 67 PARAMETER_JPA_ENTITY_MANAGER, EntityManager.class, 68 PARAMETER_JPA_QUERY_HINTS_MAP, Map .class 69 }; 70 71 public Object [] getBuiltinParameters() { 72 return JPA_BUILTIN_PARAMETERS; 73 } 74 75 82 public static final String PROPERTY_JPA_QUERY_PAGE_SIZE = JRProperties.PROPERTY_PREFIX + "ejbql.query.page.size"; 83 84 87 public static final String PROPERTY_JPA_QUERY_HINT_PREFIX = JRProperties.PROPERTY_PREFIX + "ejbql.query.hint."; 88 89 public JRQueryExecuter createQueryExecuter(JRDataset dataset, Map parameters) throws JRException { 90 return new JRJpaQueryExecuter(dataset, parameters); 91 } 92 93 96 public boolean supportsQueryParameterType(String className) { 97 return true; 98 } 99 } 100 | Popular Tags |