Why spring data jpa not issuing JOIN query?
<p>I have created two entities <code>Book</code> and <code>Book_Category</code> with one-to-many relationship. When I issued <code>BookCategoryRepository.findAll()</code>, I expected hibernate to use 'INNER JOIN' query. But it just issued query to take data from Book_Category.</p>

<p>What I am missing?  What should I do to make hibernate issue JOIN query?</p>

<p>Book.java</p>

<pre><code>@Entity
public  class Book {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
    private String name;

    @ManyToOne
    @JoinColumn(name = "book_category_id")
    private BookCategory bookCategory;
}
</code></pre>

<p>BookCategory.java</p>

<pre><code>@Entity
@Table(name = "book_category")
public  class BookCategory {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
    private String name;
    @OneToMany(mappedBy = "bookCategory", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    private Set&lt;Book&gt; books;
}
</code></pre>

<p>BookCategoryRepository.java</p>

<pre><code>public  interface BookCategoryRepository extends JpaRepository&lt;BookCategory, Integer&gt; {
}


bookCategoryRepository.findAll()
</code></pre>