Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.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
Java JPA 2.1实体图';生成空联接的s子图_Java_Postgresql_Wildfly_Jpa 2.1 - Fatal编程技术网

Java JPA 2.1实体图';生成空联接的s子图

Java JPA 2.1实体图';生成空联接的s子图,java,postgresql,wildfly,jpa-2.1,Java,Postgresql,Wildfly,Jpa 2.1,我正在使用JPA2.1中的一个新特性,名为with。它工作得很好。但是当我使用JPA时,它会生成无效的SQL。这是我的样本: @NamedEntityGraph( name="defaultGet", attributeNodes = { @NamedAttributeNode("client"), @NamedAttributeNode(value = "tests", subgraph = "testsSG") },

我正在使用JPA2.1中的一个新特性,名为with。它工作得很好。但是当我使用JPA时,它会生成无效的SQL。这是我的样本:

@NamedEntityGraph(
     name="defaultGet",
     attributeNodes = {
          @NamedAttributeNode("client"),
          @NamedAttributeNode(value = "tests", subgraph = "testsSG")
     },
     subgraphs ={
          @NamedSubgraph(
               name="testsSG",
               attributeNodes = {
                    @NamedAttributeNode("template")
               }
          )
     }
)
下面是生成的SQL:

select
    ...correct stuff....
from
    iq_applicant applicant0_ 
left outer join
    iq_test tests1_ 
        on applicant0_.id=tests1_.applicant 
left outer join
    iq_template template2_ 
        on tests1_.template=template2_.id cross 
join            
                            //WTF?? empty lane??
left outer join
    iq_client client3_ 
        on applicant0_.client=client3_.id 

那条空巷在里面干什么?这是一个bug吗?

我想这是Hibernate的问题。有几个问题:

您的方言正确配置了WildFly/Hibernate的确切版本吗?您有最新的jdbc驱动程序吗?WildFly-8.0.0.Final,Hibernate-4.3.1.Final,persistence.xml中的方言:我使用的是PostGreSQL 9.3,所以它是最新的。为什么不使用org.Hibernate.dialogue.PostgreSQL9dialogue?因为我不知道有。被替换了,还是一样的问题。我也遇到了同样的问题。这可能是与命名EntityGraph中的继承支持相关的错误。