Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polish : Hibernate2nd level cache #1599

Merged
merged 4 commits into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}
Loading