diff --git a/spring-data-rest-2/README.md b/spring-data-rest-2/README.md
new file mode 100644
index 0000000000..04a54291b0
--- /dev/null
+++ b/spring-data-rest-2/README.md
@@ -0,0 +1,20 @@
+## Spring Data REST
+
+This module contains articles about Spring Data REST
+
+### Relevant Articles:
+- [Guide to Spring Data REST Validators](https://www.baeldung.com/spring-data-rest-validators)
+- [Spring Data Web Support](https://www.baeldung.com/spring-data-web-support)
+- [Spring REST and HAL Browser](https://www.baeldung.com/spring-rest-hal)
+
+### The Course
+The "REST With Spring" Classes: http://bit.ly/restwithspring
+
+# Running the project
+The application uses [Spring Boot](http://projects.spring.io/spring-boot/), so it is easy to run. You can start it any of a few ways:
+* Run the `main` method from `SpringDataRestApplication`
+* Use the Maven Spring Boot plugin: `mvn spring-boot:run`
+* Package the application as a JAR and run it using `java -jar intro-spring-data-rest-2.jar`
+
+# Viewing the running application
+To view the running application, visit [http://localhost:8080](http://localhost:8080) in your browser
diff --git a/spring-data-rest-2/pom.xml b/spring-data-rest-2/pom.xml
new file mode 100644
index 0000000000..cf3265c46d
--- /dev/null
+++ b/spring-data-rest-2/pom.xml
@@ -0,0 +1,100 @@
+
+
+ 4.0.0
+ spring-data-rest-2
+ 1.0
+ spring-data-rest-2
+ jar
+ Intro to Spring Data REST
+
+
+ com.baeldung
+ parent-boot-2
+ 0.0.1-SNAPSHOT
+ ../parent-boot-2
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-data-rest
+
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+
+
+ org.springframework.data
+ spring-data-rest-hal-explorer
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+ org.springframework.boot
+ spring-boot-autoconfigure
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ com.h2database
+ h2
+ runtime
+
+
+ com.querydsl
+ querydsl-apt
+
+
+ com.querydsl
+ querydsl-jpa
+
+
+
+
+ ${project.artifactId}
+
+
+ com.mysema.maven
+ maven-apt-plugin
+ ${maven.version}
+
+
+ generate-sources
+
+ process
+
+
+ target/generated-sources
+ com.querydsl.apt.jpa.JPAAnnotationProcessor
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
+
+ com.baeldung.books.SpringDataRestApplication
+ 1.0
+
+
+
\ No newline at end of file
diff --git a/spring-data-rest-2/src/main/java/com/baeldung/books/SpringDataRestApplication.java b/spring-data-rest-2/src/main/java/com/baeldung/books/SpringDataRestApplication.java
new file mode 100644
index 0000000000..097a6aabd7
--- /dev/null
+++ b/spring-data-rest-2/src/main/java/com/baeldung/books/SpringDataRestApplication.java
@@ -0,0 +1,13 @@
+package com.baeldung.books;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class SpringDataRestApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(SpringDataRestApplication.class, args);
+ }
+
+}
diff --git a/spring-data-rest-2/src/main/java/com/baeldung/books/config/DbConfig.java b/spring-data-rest-2/src/main/java/com/baeldung/books/config/DbConfig.java
new file mode 100644
index 0000000000..3fe7516537
--- /dev/null
+++ b/spring-data-rest-2/src/main/java/com/baeldung/books/config/DbConfig.java
@@ -0,0 +1,65 @@
+package com.baeldung.books.config;
+
+import java.util.Properties;
+
+import javax.sql.DataSource;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.core.env.Environment;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
+import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
+
+@Configuration
+@EnableJpaRepositories(basePackages = "com.baeldung.books.repositories")
+public class DbConfig {
+
+ @Autowired
+ private Environment env;
+
+ @Bean
+ public DataSource dataSource() {
+ final DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(env.getProperty("driverClassName"));
+ dataSource.setUrl(env.getProperty("url"));
+ dataSource.setUsername(env.getProperty("user"));
+ dataSource.setPassword(env.getProperty("password"));
+ return dataSource;
+ }
+
+ @Bean
+ public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
+ final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
+ em.setDataSource(dataSource());
+ em.setPackagesToScan(new String[] { "com.baeldung.books.models" });
+ em.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
+ em.setJpaProperties(additionalProperties());
+ return em;
+ }
+
+ final Properties additionalProperties() {
+ final Properties hibernateProperties = new Properties();
+ if (env.getProperty("hibernate.hbm2ddl.auto") != null) {
+ hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto"));
+ }
+ if (env.getProperty("hibernate.dialect") != null) {
+ hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect"));
+ }
+ if (env.getProperty("hibernate.show_sql") != null) {
+ hibernateProperties.setProperty("hibernate.show_sql", env.getProperty("hibernate.show_sql"));
+ }
+ return hibernateProperties;
+ }
+
+}
+
+@Configuration
+@Profile("h2")
+@PropertySource("classpath:persistence-h2.properties")
+class H2Config {
+}
diff --git a/spring-data-rest-2/src/main/java/com/baeldung/books/config/RestConfig.java b/spring-data-rest-2/src/main/java/com/baeldung/books/config/RestConfig.java
new file mode 100644
index 0000000000..8bcde7c97b
--- /dev/null
+++ b/spring-data-rest-2/src/main/java/com/baeldung/books/config/RestConfig.java
@@ -0,0 +1,21 @@
+package com.baeldung.books.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
+import org.springframework.data.rest.core.mapping.ExposureConfiguration;
+import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer;
+import org.springframework.http.HttpMethod;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+
+import com.baeldung.books.models.WebsiteUser;
+
+@Configuration
+public class RestConfig implements RepositoryRestConfigurer {
+
+ @Override
+ public void configureRepositoryRestConfiguration(RepositoryRestConfiguration repositoryRestConfiguration,
+ CorsRegistry cors) {
+ ExposureConfiguration config = repositoryRestConfiguration.getExposureConfiguration();
+ config.forDomainType(WebsiteUser.class).withItemExposure((metadata, httpMethods) -> httpMethods.disable(HttpMethod.PATCH));
+ }
+}
diff --git a/spring-data-rest/src/main/java/com/baeldung/books/config/ValidatorEventRegister.java b/spring-data-rest-2/src/main/java/com/baeldung/books/config/ValidatorEventRegister.java
similarity index 97%
rename from spring-data-rest/src/main/java/com/baeldung/books/config/ValidatorEventRegister.java
rename to spring-data-rest-2/src/main/java/com/baeldung/books/config/ValidatorEventRegister.java
index bbaf9a2771..3301443203 100644
--- a/spring-data-rest/src/main/java/com/baeldung/books/config/ValidatorEventRegister.java
+++ b/spring-data-rest-2/src/main/java/com/baeldung/books/config/ValidatorEventRegister.java
@@ -1,30 +1,30 @@
-package com.baeldung.books.config;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.data.rest.core.event.ValidatingRepositoryEventListener;
-import org.springframework.validation.Validator;
-
-@Configuration
-public class ValidatorEventRegister implements InitializingBean {
-
- @Autowired
- ValidatingRepositoryEventListener validatingRepositoryEventListener;
-
- @Autowired
- private Map validators;
-
- @Override
- public void afterPropertiesSet() throws Exception {
- List events = Arrays.asList("beforeCreate", "afterCreate", "beforeSave", "afterSave", "beforeLinkSave", "afterLinkSave", "beforeDelete", "afterDelete");
-
- for (Map.Entry entry : validators.entrySet()) {
- events.stream().filter(p -> entry.getKey().startsWith(p)).findFirst().ifPresent(p -> validatingRepositoryEventListener.addValidator(p, entry.getValue()));
- }
- }
-}
+package com.baeldung.books.config;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.rest.core.event.ValidatingRepositoryEventListener;
+import org.springframework.validation.Validator;
+
+@Configuration
+public class ValidatorEventRegister implements InitializingBean {
+
+ @Autowired
+ ValidatingRepositoryEventListener validatingRepositoryEventListener;
+
+ @Autowired
+ private Map validators;
+
+ @Override
+ public void afterPropertiesSet() throws Exception {
+ List events = Arrays.asList("beforeCreate", "afterCreate", "beforeSave", "afterSave", "beforeLinkSave", "afterLinkSave", "beforeDelete", "afterDelete");
+
+ for (Map.Entry entry : validators.entrySet()) {
+ events.stream().filter(p -> entry.getKey().startsWith(p)).findFirst().ifPresent(p -> validatingRepositoryEventListener.addValidator(p, entry.getValue()));
+ }
+ }
+}
diff --git a/spring-data-rest/src/main/java/com/baeldung/books/exception/handlers/RestResponseEntityExceptionHandler.java b/spring-data-rest-2/src/main/java/com/baeldung/books/exception/handlers/RestResponseEntityExceptionHandler.java
similarity index 98%
rename from spring-data-rest/src/main/java/com/baeldung/books/exception/handlers/RestResponseEntityExceptionHandler.java
rename to spring-data-rest-2/src/main/java/com/baeldung/books/exception/handlers/RestResponseEntityExceptionHandler.java
index 4a961e5250..e87176af69 100644
--- a/spring-data-rest/src/main/java/com/baeldung/books/exception/handlers/RestResponseEntityExceptionHandler.java
+++ b/spring-data-rest-2/src/main/java/com/baeldung/books/exception/handlers/RestResponseEntityExceptionHandler.java
@@ -1,26 +1,26 @@
-package com.baeldung.books.exception.handlers;
-
-import org.springframework.data.rest.core.RepositoryConstraintViolationException;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.validation.ObjectError;
-import org.springframework.web.bind.annotation.ControllerAdvice;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.context.request.WebRequest;
-import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
-
-import java.util.stream.Collectors;
-
-@ControllerAdvice
-public class RestResponseEntityExceptionHandler extends ResponseEntityExceptionHandler {
-
- @ExceptionHandler({ RepositoryConstraintViolationException.class })
- public ResponseEntity