-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : use SQLStatementValidator and ValidationGroups
- Loading branch information
1 parent
6c7af2e
commit d34246a
Showing
21 changed files
with
460 additions
and
200 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ple/custom/sequence/config/JpaConfig.java → .../custom/sequence/config/db/JpaConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../LazyConnectionDataSourceProxyConfig.java → .../LazyConnectionDataSourceProxyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...edNumberFormattedSequenceIdGenerator.java → ...edNumberFormattedSequenceIdGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...quence/config/StringPrefixedSequence.java → ...nce/config/db/StringPrefixedSequence.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...boot-data-customsequence/src/main/java/com/example/custom/sequence/entities/Customer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
jpa/boot-data-customsequence/src/main/java/com/example/custom/sequence/entities/Order.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...stomsequence/src/main/java/com/example/custom/sequence/model/request/CustomerRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
package com.example.custom.sequence.model.request; | ||
|
||
import jakarta.validation.Valid; | ||
import jakarta.validation.constraints.NotBlank; | ||
import java.util.List; | ||
|
||
public record CustomerRequest( | ||
@NotBlank(message = "Text cannot be empty") String text, List<OrderRequest> orders) {} | ||
@NotBlank(message = "Text cannot be empty") String text, | ||
@Valid List<OrderRequest> orders) {} |
8 changes: 5 additions & 3 deletions
8
...-customsequence/src/main/java/com/example/custom/sequence/model/request/OrderRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
package com.example.custom.sequence.model.request; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotEmpty; | ||
|
||
public record OrderRequest( | ||
@NotEmpty(message = "Text cannot be empty") String text, | ||
@NotBlank(message = "CustomerId cannot be blank") String customerId) {} | ||
@NotBlank(message = "Text cannot be empty") String text, | ||
@NotBlank( | ||
message = "CustomerId cannot be blank", | ||
groups = ValidationGroups.GroupCheck.class) | ||
String customerId) {} |
8 changes: 8 additions & 0 deletions
8
...tomsequence/src/main/java/com/example/custom/sequence/model/request/ValidationGroups.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.example.custom.sequence.model.request; | ||
|
||
public interface ValidationGroups { | ||
|
||
interface SkipGroupCheck {} | ||
|
||
interface GroupCheck {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...esources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
com.example.custom.sequence.config.LazyConnectionDataSourceProxyConfig | ||
com.example.custom.sequence.config.db.LazyConnectionDataSourceProxyConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.