Skip to content

Commit

Permalink
FEATURE : modify entity model for composite primary key #4
Browse files Browse the repository at this point in the history
  • Loading branch information
stephano-tri committed Mar 5, 2024
1 parent 131f353 commit efe97de
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/main/kotlin/eom/improve/kafkaboot/model/FilmActor.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package eom.improve.kafkaboot.model

import java.io.Serializable
import java.time.LocalDateTime

data class FilmActor(
val actorId: Int,
val filmId: Int,
val lastUpdate: LocalDateTime
) : Serializable
10 changes: 10 additions & 0 deletions src/main/kotlin/eom/improve/kafkaboot/model/FilmCategory.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package eom.improve.kafkaboot.model

import java.io.Serializable
import java.time.LocalDateTime

data class FilmCategory(
val filmId: Int,
val categoryId: Int,
val lastUpdate: LocalDateTime
) : Serializable
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
package eom.improve.kafkaboot.repository

interface FilmActorRepository {
import eom.improve.kafkaboot.model.FilmActor
import org.springframework.data.r2dbc.repository.R2dbcRepository
import reactor.core.publisher.Flux
import reactor.core.publisher.Mono

interface FilmActorRepository : R2dbcRepository<FilmActor, Int> {
fun findAllByFilmId(filmId: Int) : Flux<FilmActor>
fun deleteByFilmId(filmId: Int) : Mono<Void>
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
package eom.improve.kafkaboot.repository

interface FilmCategoryRepository {
import eom.improve.kafkaboot.model.FilmCategory
import org.springframework.data.r2dbc.repository.R2dbcRepository
import reactor.core.publisher.Flux
import reactor.core.publisher.Mono

interface FilmCategoryRepository : R2dbcRepository<FilmCategory, Int> {
fun findAllByFilmId(filmId: Int) : Flux<FilmCategory>
fun deleteByFilmId(filmId: Int) : Mono<Void>
}

0 comments on commit efe97de

Please sign in to comment.