From 78d0b85b2dc69d132ec15b15007cd440ad5b9fab Mon Sep 17 00:00:00 2001 From: dupirefr Date: Tue, 19 Feb 2019 07:24:07 +0100 Subject: [PATCH] [BAEL-2538] Rearranged classes --- .../com/baeldung/util/LocalDateConverter.java | 25 ------------------- .../UserRepositoryIntegrationTest.java | 0 2 files changed, 25 deletions(-) delete mode 100644 persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/util/LocalDateConverter.java rename persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/{user => }/UserRepositoryIntegrationTest.java (100%) diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/util/LocalDateConverter.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/util/LocalDateConverter.java deleted file mode 100644 index 00fd378b05..0000000000 --- a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/util/LocalDateConverter.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.util; - -import javax.persistence.AttributeConverter; -import javax.persistence.Converter; -import java.sql.Date; -import java.time.LocalDate; -import java.util.Optional; - -@Converter(autoApply = true) -public class LocalDateConverter implements AttributeConverter { - - @Override - public Date convertToDatabaseColumn(LocalDate localDate) { - return Optional.ofNullable(localDate) - .map(Date::valueOf) - .orElse(null); - } - - @Override - public LocalDate convertToEntityAttribute(Date date) { - return Optional.ofNullable(date) - .map(Date::toLocalDate) - .orElse(null); - } -} \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/user/UserRepositoryIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/UserRepositoryIntegrationTest.java similarity index 100% rename from persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/user/UserRepositoryIntegrationTest.java rename to persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/UserRepositoryIntegrationTest.java