Skip to content

Commit

Permalink
polish : Hibernate2nd level cache
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Dec 25, 2024
1 parent d249308 commit f0f59ba
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

@SpringBootApplication
@EnableConfigurationProperties({ApplicationProperties.class})
public class Application {
public class Hibernate2ndLevelCacheApplication {

public static void main(String[] args) {
SpringApplication.run(Application.class, args);
SpringApplication.run(Hibernate2ndLevelCacheApplication.class, args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import com.example.hibernatecache.entities.Customer;
import io.hypersistence.utils.spring.repository.BaseJpaRepository;
import io.hypersistence.utils.spring.repository.HibernateRepository;
import jakarta.persistence.QueryHint;
import java.util.Optional;
import org.springframework.data.jpa.repository.EntityGraph;
Expand All @@ -15,9 +14,7 @@
import org.springframework.transaction.annotation.Transactional;

public interface CustomerRepository
extends BaseJpaRepository<Customer, Long>,
HibernateRepository<Customer>,
PagingAndSortingRepository<Customer, Long> {
extends BaseJpaRepository<Customer, Long>, PagingAndSortingRepository<Customer, Long> {

@Transactional(readOnly = true)
@QueryHints(@QueryHint(name = HINT_CACHEABLE, value = "true"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@

import com.example.hibernatecache.entities.OrderItem;
import io.hypersistence.utils.spring.repository.BaseJpaRepository;
import io.hypersistence.utils.spring.repository.HibernateRepository;
import org.springframework.data.repository.PagingAndSortingRepository;

public interface OrderItemRepository
extends BaseJpaRepository<OrderItem, Long>,
HibernateRepository<OrderItem>,
PagingAndSortingRepository<OrderItem, Long> {
extends BaseJpaRepository<OrderItem, Long>, PagingAndSortingRepository<OrderItem, Long> {

void deleteAll();
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

import com.example.hibernatecache.entities.Order;
import io.hypersistence.utils.spring.repository.BaseJpaRepository;
import io.hypersistence.utils.spring.repository.HibernateRepository;
import org.springframework.data.repository.PagingAndSortingRepository;

public interface OrderRepository
extends BaseJpaRepository<Order, Long>, HibernateRepository<Order>, PagingAndSortingRepository<Order, Long> {
public interface OrderRepository extends BaseJpaRepository<Order, Long>, PagingAndSortingRepository<Order, Long> {

void deleteAll();
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.example.hibernatecache;

import com.example.hibernatecache.common.ContainersConfig;
import org.springframework.boot.SpringApplication;

public class TestHibernate2ndLevelCacheApplication {

public static void main(String[] args) {
SpringApplication.from(Hibernate2ndLevelCacheApplication::main)
.with(ContainersConfig.class)
.withAdditionalProfiles("local")
.run(args);
}
}

0 comments on commit f0f59ba

Please sign in to comment.