Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
EclipseLink JPA:无法在报表查询上设置提取组_Jpa_Report_Eclipselink_Entitygraph - Fatal编程技术网

EclipseLink JPA:无法在报表查询上设置提取组

EclipseLink JPA:无法在报表查询上设置提取组,jpa,report,eclipselink,entitygraph,Jpa,Report,Eclipselink,Entitygraph,EclipseLink:无法在报表查询上设置提取组 TypedQuery<Q> query = em.createQuery(criteriaQuery); query.setHint("javax.persistence.fetchgraph", entityGraph); List results = query.getResultList(); 谢谢。在EclipseLink上提出一个错误,因为它不符合JPA 2.1规范。您应该能够在任何JPQL查询

EclipseLink:无法在报表查询上设置提取组

    TypedQuery<Q> query = em.createQuery(criteriaQuery);
    query.setHint("javax.persistence.fetchgraph", entityGraph); 
    List results = query.getResultList();

谢谢。

在EclipseLink上提出一个错误,因为它不符合JPA 2.1规范。您应该能够在任何JPQL查询上设置EntityGraph;实现对它做什么由它来决定,但它不能抛出这种性质的异常。报表查询是不返回实体的查询。您的查询是什么?它是一个groupBy查询,其查询结果类型(选择)是包含实体的Object[]。提取组应应用于实体。是否已报告此情况?我有一个查询,它返回的实体在连接的子属性上有一个
groupby
,但抛出了相同的异常。查询:
@NamedQuery(name=GroupMember.FIND_BY_GROUP,Query=“从组成员中选择gm加入gm.花名册ro左加入ro.teamMembers tm加入ro.team te加入te.club cl加入gm.GROUP gr加入gr.groupLabel gl加入gr.round rd其中rd.id=:roundId和gl.code=:groupCode按ro.id分组按cl.code按cl.code排序,cl.name”)
->这应该是每个花名册ID返回一个组成员,但子成员加入每个n个团队成员返回n个实体…查询
@NamedQuery(name=Game.FIND_ALL_JOIN_SCORES_group_BY_Game_ID,query=“从Game ga中选择ga加入ga.SCORES sc group BY ga.ID”)
,请参见此处的测试示例:
6112: FETCH_GROUP_NOT_SUPPORT_ON_REPORT_QUERY
Cause: Fetch group cannot be set on report query.
Action: Remove the fetch group setting on ReportQuery, or use ReadObjectQuery or ReadObjectQuery instead.