Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove spring data rest Dependency und Konfiguration #134

Merged
merged 8 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
MrSebastian marked this conversation as resolved.
Show resolved Hide resolved
# 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
Loading