-
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 : adds R2DBC Test * fix void dereference issue * use Jooq auto mapping feature * adds more assertions * format sql and removes unnecessary initialization * moves common logic to repository * expose as a method for reusability * make more readable
- Loading branch information
1 parent
82d1c3a
commit 62ff5e3
Showing
14 changed files
with
454 additions
and
185 deletions.
There are no files selected for viewing
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
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
...m/example/jooq/r2dbc/entities/Status.java → .../com/example/jooq/r2dbc/model/Status.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,4 +1,4 @@ | ||
package com.example.jooq.r2dbc.entities; | ||
package com.example.jooq.r2dbc.model; | ||
|
||
public enum Status { | ||
DRAFT, | ||
|
3 changes: 3 additions & 0 deletions
3
...t-jooq-r2dbc-sample/src/main/java/com/example/jooq/r2dbc/model/response/PostResponse.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,11 +1,14 @@ | ||
package com.example.jooq.r2dbc.model.response; | ||
|
||
import com.example.jooq.r2dbc.model.Status; | ||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
public record PostResponse( | ||
UUID id, | ||
String title, | ||
String content, | ||
String createdBy, | ||
Status status, | ||
List<PostCommentResponse> comments, | ||
List<String> tags) {} |
7 changes: 7 additions & 0 deletions
7
...-jooq-r2dbc-sample/src/main/java/com/example/jooq/r2dbc/repository/PostTagRepository.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,7 @@ | ||
package com.example.jooq.r2dbc.repository; | ||
|
||
import com.example.jooq.r2dbc.entities.PostTagRelation; | ||
import java.util.UUID; | ||
import org.springframework.data.r2dbc.repository.R2dbcRepository; | ||
|
||
public interface PostTagRepository extends R2dbcRepository<PostTagRelation, UUID> {} |
4 changes: 4 additions & 0 deletions
4
...c-sample/src/main/java/com/example/jooq/r2dbc/repository/custom/CustomPostRepository.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,10 +1,14 @@ | ||
package com.example.jooq.r2dbc.repository.custom; | ||
|
||
import com.example.jooq.r2dbc.model.response.PostResponse; | ||
import org.jooq.Condition; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import reactor.core.publisher.Flux; | ||
import reactor.core.publisher.Mono; | ||
|
||
public interface CustomPostRepository { | ||
Mono<Page<PostResponse>> findByKeyword(String keyword, Pageable pageable); | ||
|
||
Flux<PostResponse> retrievePostsWithCommentsAndTags(Condition condition); | ||
} |
Oops, something went wrong.