Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,16 @@ class ScheduleFindService(
fun findSchedulesBetween(
from: LocalDate,
toInclusive: LocalDate
): List<ScheduleEntity> = scheduleRepository.findScheduleEntitiesByDateBetween(from, toInclusive)
): List<ScheduleEntity> =
scheduleRepository
.findAll {
select(entity(ScheduleEntity::class))
.from(entity(ScheduleEntity::class))
.where(
and(
path(ScheduleEntity::date).greaterThanOrEqualTo(from),
path(ScheduleEntity::date).lessThanOrEqualTo(toInclusive)
)
)
}.filterNotNull()
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import co.yappuworld.schedule.infrastructure.entity.ScheduleEntity
import co.yappuworld.schedule.infrastructure.entity.SessionEntity
import com.linecorp.kotlinjdsl.support.spring.data.jpa.repository.KotlinJdslJpqlExecutor
import org.springframework.data.jpa.repository.JpaRepository
import java.time.LocalDate
import java.util.UUID

interface ScheduleRepository :
Expand All @@ -13,13 +12,4 @@ interface ScheduleRepository :
KotlinJdslJpqlExecutor {

fun findAllByIdIn(ids: List<UUID>): List<SessionEntity>

/**
* @param from Inclusive
* @param to Inclusive
*/
fun findScheduleEntitiesByDateBetween(
from: LocalDate,
to: LocalDate
): List<ScheduleEntity>
}
Loading