title: What is the difference between explicit and implicit JOIN in JPA? (performance)
body: <p>These days I'm reading about <code>JPA</code>. I've learned that it is possible to use <code>explicit</code>or <code>implicit</code> <code>JOIN</code> in JPQL. </p>
  
  <p><strong>Explicit join</strong></p>
  
  <blockquote>
    <p>em.createQuery(“SELECT b.title, p.name FROM Book b JOIN b.publisher
    p”).getResultList();</p>
  </blockquote>
  
  <p><strong>Implicit join</strong></p>
  
  <blockquote>
    <p>em.createQuery(“SELECT b.title, b.publisher.name FROM Book
    b”).getResultList();</p>
  </blockquote>
  
  <p>The source of these examples: <a href="https://www.thoughts-on-java.org/query-complex-jpa-hibernate/" rel="nofollow noreferrer">link</a></p>
  
  <p><strong>My question is:</strong> Is there any difference in terms of performance between <code>explicit</code> and <code>implict</code> JOIN?</p>
  
  <hr>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I've read what you've written @MatteoBaldi and @Kayaman, I've done some tests and I want to share the results with you.</p>
  
  <p>I've created two entities: <code>students</code> and <code>course</code>, and I had a <code>manyToOne</code> (many students attend one course). I've used <code>EcpliseLink</code> Implementation of <code>JPA</code>.</p>
  
  <p>Query = select students and dummyFiled from course, scenarios of execution:</p>
  
  <ol>
  <li>manyToOne (defaultFetch -> eager), implicit JOIN. <strong>Result:</strong> a single SQL query that does all the work.</li>
  <li>manyToOne (Fetch - > lazy), implicit JOIN. <strong>Result:</strong> the same SQL query as 1.</li>
  <li>manyToOne (defaultFetch - > eager), explicit JOIN. <strong>Result:</strong> the same SQL query as 1.</li>
  <li>manyToOne (Fetch - > lazy), explicit JOIN. <strong>Result:</strong> the same SQL query as 1.</li>
  </ol>
  
  <p>So in my environement of test (EclipseLink,..) I had the same SQL query that  was generated from my JPQL queries. So I can say that the performance will be same (ofcourse, I say again in my conditions of tests, I hope that someone can confirm/correct my results and make a general rule.</p>