I have 2 different repositories in the same Spring Boot project.
I would like to define different batch sizes for the 2 different repositories. However, I could not find any solution for Spring Data Jpa config.
The repositories are given below:
@Repository
public interface ItemRepository extends JpaRepository<Item, String> {
Page<Item> findItemByCreationDateBefore(Timestamp creationDate, Pageable pageable);
}
@Repository
public interface CarRepository extends JpaRepository<Car, String> {
@Query("SELECT c FROM Car c WHERE c.journeyCode = :journeyCode " +
"AND c.currentLocationId = :currentLocationId")
Page<Delivery> findCars(Long journeyCode, Long currentLocationId, Pageable pageable);
}
The batch size configuration is given below
jpg:
spring:
properties:
hibernate:
jdbc:
batch_size: 4
order_inserts: true
order_updates: true
Is it possible configuring the batch sizes that way? If it is possible, how can I implement this?