extract spring-caching module

This commit is contained in:
Denis 2019-08-31 15:51:56 +02:00
parent 9fd2fb32ca
commit e848a0ffcf
25 changed files with 338 additions and 299 deletions

View File

@ -17,15 +17,12 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [Running Setup Data on Startup in Spring](http://www.baeldung.com/running-setup-logic-on-startup-in-spring)
- [Quick Guide to Spring Controllers](http://www.baeldung.com/spring-controllers)
- [Quick Guide to Spring Bean Scopes](http://www.baeldung.com/spring-bean-scopes)
- [Introduction To Ehcache](http://www.baeldung.com/ehcache)
- [Custom Scope in Spring](http://www.baeldung.com/spring-custom-scope)
- [A CLI with Spring Shell](http://www.baeldung.com/spring-shell-cli)
- [JasperReports with Spring](http://www.baeldung.com/spring-jasper)
- [Model, ModelMap, and ModelView in Spring MVC](http://www.baeldung.com/spring-mvc-model-model-map-model-view)
- [A Guide To Caching in Spring](http://www.baeldung.com/spring-cache-tutorial)
- [@Order in Spring](http://www.baeldung.com/spring-order)
- [Spring Web Contexts](http://www.baeldung.com/spring-web-contexts)
- [Spring Cache Creating a Custom KeyGenerator](http://www.baeldung.com/spring-cache-custom-keygenerator)
- [Spring @Primary Annotation](http://www.baeldung.com/spring-primary)
- [Spring Events](https://www.baeldung.com/spring-events)
- [Spring Null-Safety Annotations](https://www.baeldung.com/spring-null-safety-annotations)

View File

@ -147,10 +147,6 @@
<version>${easymock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
@ -243,7 +239,6 @@
<!-- util -->
<guava.version>25.1-jre</guava.version>
<ehcache.version>3.5.2</ehcache.version>
<easymock.version>3.6</easymock.version>
<assertj.version>3.6.1</assertj.version>
<jasperreports.version>6.6.0</jasperreports.version>

View File

@ -1,4 +1,4 @@
package org.baeldung.model;
package org.baeldung.caching.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@ -1,6 +1,6 @@
package org.baeldung.repository;
import org.baeldung.model.User;
import org.baeldung.caching.model.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

View File

@ -1,7 +1,7 @@
package org.baeldung.repository;
import org.baeldung.boot.config.H2JpaConfig;
import org.baeldung.model.User;
import org.baeldung.caching.model.User;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;

4
spring-caching/README.md Normal file
View File

@ -0,0 +1,4 @@
### Relevant articles:
- [Introduction To Ehcache](http://www.baeldung.com/ehcache)
- [A Guide To Caching in Spring](http://www.baeldung.com/spring-cache-tutorial)
- [Spring Cache Creating a Custom KeyGenerator](http://www.baeldung.com/spring-cache-custom-keygenerator)

43
spring-caching/pom.xml Normal file
View File

@ -0,0 +1,43 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-caching</artifactId>
<version>0.1-SNAPSHOT</version>
<name>spring-caching</name>
<packaging>war</packaging>
<parent>
<artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<ehcache.version>3.5.2</ehcache.version>
</properties>
</project>

View File

@ -1,6 +1,6 @@
package org.baeldung.caching.example;
import org.baeldung.model.Book;
import org.baeldung.caching.model.Book;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.model;
package org.baeldung.caching.model;
public class Book {