Loading core/pom.xml +5 −23 Original line number Diff line number Diff line Loading @@ -23,6 +23,11 @@ <artifactId>postgresql</artifactId> <version>42.5.4</version> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> Loading @@ -41,12 +46,6 @@ <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>RELEASE</version> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> Loading @@ -64,23 +63,6 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-maven-plugin</artifactId> <executions> <execution> <id>integration-test</id> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <apiDocsUrl>http://localhost:8080/openapi.yaml</apiDocsUrl> <outputFileName>openapi.yaml</outputFileName> <outputDir>..</outputDir> </configuration> </plugin> </plugins> </build> </project> No newline at end of file core/src/main/java/cz/muni/fi/pa165/core/CoreApplication.java +2 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,8 @@ package cz.muni.fi.pa165.core; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.FilterType; @SpringBootApplication public class CoreApplication { Loading core/src/main/java/cz/muni/fi/pa165/core/DataInitializer.java +1 −2 Original line number Diff line number Diff line Loading @@ -23,9 +23,8 @@ import org.springframework.stereotype.Component; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @RequiredArgsConstructor @Component @RequiredArgsConstructor public class DataInitializer implements ApplicationRunner { private final UserService userService; private final DeviceService deviceService; Loading core/src/main/java/cz/muni/fi/pa165/core/common/DomainFacade.java +1 −5 Original line number Diff line number Diff line Loading @@ -91,11 +91,7 @@ public abstract class DomainFacade<E extends DomainObject, * @return the DTO representation of the created entity */ public T create(C createDto) { try { return mapper.toDto(service.create(mapper.fromCreateDto(createDto))); } catch (DataIntegrityViolationException e) { throw new ResponseStatusException(HttpStatus.CONFLICT, "Entity with the same name already exists", e); } } /** Loading core/src/main/java/cz/muni/fi/pa165/core/common/DomainService.java +3 −1 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ public abstract class DomainService<T extends DomainObject> { .orElseThrow(() -> new EntityNotFoundException("Entity with '" + id + "' not found.")); } /** * Deletes all entities by setting their deletion datetime. */ Loading Loading @@ -141,11 +142,12 @@ public abstract class DomainService<T extends DomainObject> { return entity; } /** * Deletes all entities from the database without soft-delete functionality. */ @Transactional public void deleteAllHardDelete() { public void hardDeleteAll() { getRepository().deleteAll(); } } Loading
core/pom.xml +5 −23 Original line number Diff line number Diff line Loading @@ -23,6 +23,11 @@ <artifactId>postgresql</artifactId> <version>42.5.4</version> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> Loading @@ -41,12 +46,6 @@ <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>RELEASE</version> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> Loading @@ -64,23 +63,6 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-maven-plugin</artifactId> <executions> <execution> <id>integration-test</id> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <apiDocsUrl>http://localhost:8080/openapi.yaml</apiDocsUrl> <outputFileName>openapi.yaml</outputFileName> <outputDir>..</outputDir> </configuration> </plugin> </plugins> </build> </project> No newline at end of file
core/src/main/java/cz/muni/fi/pa165/core/CoreApplication.java +2 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,8 @@ package cz.muni.fi.pa165.core; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.FilterType; @SpringBootApplication public class CoreApplication { Loading
core/src/main/java/cz/muni/fi/pa165/core/DataInitializer.java +1 −2 Original line number Diff line number Diff line Loading @@ -23,9 +23,8 @@ import org.springframework.stereotype.Component; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @RequiredArgsConstructor @Component @RequiredArgsConstructor public class DataInitializer implements ApplicationRunner { private final UserService userService; private final DeviceService deviceService; Loading
core/src/main/java/cz/muni/fi/pa165/core/common/DomainFacade.java +1 −5 Original line number Diff line number Diff line Loading @@ -91,11 +91,7 @@ public abstract class DomainFacade<E extends DomainObject, * @return the DTO representation of the created entity */ public T create(C createDto) { try { return mapper.toDto(service.create(mapper.fromCreateDto(createDto))); } catch (DataIntegrityViolationException e) { throw new ResponseStatusException(HttpStatus.CONFLICT, "Entity with the same name already exists", e); } } /** Loading
core/src/main/java/cz/muni/fi/pa165/core/common/DomainService.java +3 −1 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ public abstract class DomainService<T extends DomainObject> { .orElseThrow(() -> new EntityNotFoundException("Entity with '" + id + "' not found.")); } /** * Deletes all entities by setting their deletion datetime. */ Loading Loading @@ -141,11 +142,12 @@ public abstract class DomainService<T extends DomainObject> { return entity; } /** * Deletes all entities from the database without soft-delete functionality. */ @Transactional public void deleteAllHardDelete() { public void hardDeleteAll() { getRepository().deleteAll(); } }