Loading tutorials
@Entity, @Id, @OneToMany, @ManyToOne), Spring Data JPA repositories, and how @Transactional works in Spring Boot. It uses the Author and Book model from the previous chapter.3 min read@Entity, @Id, @OneToMany, @ManyToOne), Spring Data JPA repositories, and how a Spring @Transactional method works. It uses the Author and Book model from the earlier chapters.2 min readAuthor and Book model from the earlier chapters. An author has many books, and each book points back to one author.3 min readAuthor and Book model and the N+1 pattern from the earlier chapters.2 min readJOIN FETCH works. An entity graph achieves the same result as JOIN FETCH, but you declare it on the repository method and leave the query alone.3 min readGROUP BY. It uses the Author and Book model from the earlier chapters.2 min readjoin fetch. It uses the Author and Book model from earlier chapters. Collection fetch joins fix N+1, but they cause two problems of their own: in-memory pagination and multiple bags.2 min readJOIN FETCH, @EntityGraph, batch fetching, and DTO projections. Here you decide which fix to use for a given query.2 min readjoin fetch, or adds a getter call in a loop, and every test still passes. This chapter adds a test that fails when the number of SQL statements goes up. It assumes you have read the earlier chapt2 min read@EntityGraph, batch fetching, DTO projections). It also assumes you can read Hibernate statistics. Caching is the last tool to reach for, not the first.2 min read