Skip to content

Commit

Permalink
Merge pull request #134 from it-at-m/remove-spring-data-rest
Browse files Browse the repository at this point in the history
Remove spring data rest Dependency und Konfiguration
  • Loading branch information
MrSebastian committed Apr 16, 2024
2 parents 77c0ff7 + f7babcd commit 57aa80f
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 172 deletions.
4 changes: 0 additions & 4 deletions wls-broadcast-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,6 @@
</dependency>

<!-- Spring developer tools -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-rest-hal-explorer</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.security.access.prepost.PreAuthorize;

/**
* Provides a Repository for {@link TheEntity}. This Repository is exported as a REST resource.
* <p>
* The Repository handles CRUD Operations. Every Operation is secured and takes care of the tenancy.
* For specific Documentation on how the generated REST point behaves, please consider the Spring
* Data Rest Reference
* For specific Documentation on how the generated REST point
* behaves, please consider the Spring Data Rest Reference
* <a href="http://docs.spring.io/spring-data/rest/docs/current/reference/html/">here</a>.
* </p>
*/
@RepositoryRestResource
@PreAuthorize("hasAuthority(T(de.muenchen.oss.wahllokalsystem.security.AuthoritiesEnum).WLS_BROADCAST_SERVICE_READ_THEENTITY.name())")
public interface TheEntityRepository extends CrudRepository<TheEntity, UUID> { //NOSONAR

Expand All @@ -45,8 +43,9 @@ public interface TheEntityRepository extends CrudRepository<TheEntity, UUID> { /
/**
* Create or update a {@link TheEntity}.
* <p>
* If the id already exists, the {@link TheEntity} will be overridden, hence update.
* If the id does not already exist, a new {@link TheEntity} will be created, hence create.
* If the id already exists, the {@link TheEntity} will be overridden, hence update. If the id does
* not already exist, a new {@link TheEntity} will be
* created, hence create.
* </p>
*
* @param theEntity The {@link TheEntity} that will be saved.
Expand All @@ -60,8 +59,9 @@ public interface TheEntityRepository extends CrudRepository<TheEntity, UUID> { /
/**
* Create or update a collection of {@link TheEntity}.
* <p>
* If the id already exists, the {@link TheEntity}s will be overridden, hence update.
* If the id does not already exist, the new {@link TheEntity}s will be created, hence create.
* If the id already exists, the {@link TheEntity}s will be overridden, hence update. If the id does
* not already exist, the new {@link TheEntity}s will be
* created, hence create.
* </p>
*
* @param entities The {@link TheEntity} that will be saved.
Expand Down
21 changes: 6 additions & 15 deletions wls-broadcast-service/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
spring:

# Spring data rest
data:
rest:
# Definition of page size for PagingAndSortingRepository
max-page-size: 0x7fffffff
default-page-size: 0x7fffffff
return-body-on-update: true
return-body-on-create: true

# Spring JPA
h2.console.enabled: true
jpa:
database: H2
hibernate:
# always drop and create the db should be the best
# configuration for local (development) mode. this
# is also the default, that spring offers by convention.
# but here explicite:
ddl-auto: create-drop
naming.physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
# always drop and create the db should be the best
# configuration for local (development) mode. this
# is also the default, that spring offers by convention.
# but here explicite:
ddl-auto: create-drop
naming.physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
# Logging for database operation
show-sql: true
properties:
Expand Down
9 changes: 0 additions & 9 deletions wls-broadcast-service/src/main/resources/application-kon.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
spring:

# Spring data rest
data:
rest:
# Definition of page size for PagingAndSortingRepository
max-page-size: 0x7fffffff
default-page-size: 0x7fffffff
return-body-on-update: true
return-body-on-create: true

# Spring JPA
h2.console.enabled: true
jpa:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ server:
port: 39146
spring:

# Spring data rest
data:
rest:
# Definition of page size for PagingAndSortingRepository
max-page-size: 0x7fffffff
default-page-size: 0x7fffffff
return-body-on-update: true
return-body-on-create: true

# Spring JPA
h2.console.enabled: true
jpa:
Expand Down
9 changes: 0 additions & 9 deletions wls-broadcast-service/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
spring:

# Spring data rest
data:
rest:
# Definition of page size for PagingAndSortingRepository
max-page-size: 0x7fffffff
default-page-size: 0x7fffffff
return-body-on-update: true
return-body-on-create: true

# Spring JPA
h2.console.enabled: true
jpa:
Expand Down
9 changes: 0 additions & 9 deletions wls-broadcast-service/src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
spring:

# Spring data rest
data:
rest:
# Definition of page size for PagingAndSortingRepository
max-page-size: 0x7fffffff
default-page-size: 0x7fffffff
return-body-on-update: true
return-body-on-create: true

# Spring JPA
h2.console.enabled: true
jpa:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import de.muenchen.oss.wahllokalsystem.domain.TheEntity;
import de.muenchen.oss.wahllokalsystem.rest.TheEntityRepository;
import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
Expand Down Expand Up @@ -54,6 +55,7 @@ class UnicodeConfigurationTest {
private TheEntityRepository theEntityRepository;

@Test
@Disabled("rework with real controller")
void testForNfcNormalization() {
// Persist entity with decomposed string.
final TheEntityDto theEntityDto = new TheEntityDto();
Expand Down
9 changes: 0 additions & 9 deletions wls-broadcast-service/src/test/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
spring:

# Spring data rest
data:
rest:
# Definition of page size for PagingAndSortingRepository
max-page-size: 0x7fffffff
default-page-size: 0x7fffffff
return-body-on-update: true
return-body-on-create: true

# Spring JPA
h2.console.enabled: true
jpa:
Expand Down

0 comments on commit 57aa80f

Please sign in to comment.