3

Entity Graphs with QueryDSLと呼ばれる JPA 2.1 の新機能を使用しています。それはうまくいっています。しかし、subgraphを使用すると、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 

あの空のレーンはそこで何をしているのですか?これはバグですか?

4

1 に答える 1