mirror of
https://github.com/2martens/tsw-timetable.git
synced 2026-10-17 16:06:51 +02:00
Added findBy methods to cover unique indices
This commit is contained in:
+5
-2
@@ -1,7 +1,10 @@
|
|||||||
package de.twomartens.timetable.bahnApi.repository
|
package de.twomartens.timetable.bahnApi.repository
|
||||||
|
|
||||||
|
import de.twomartens.timetable.bahnApi.model.Eva
|
||||||
import de.twomartens.timetable.bahnApi.model.db.BahnStation
|
import de.twomartens.timetable.bahnApi.model.db.BahnStation
|
||||||
|
import org.bson.types.ObjectId
|
||||||
import org.springframework.data.mongodb.repository.MongoRepository
|
import org.springframework.data.mongodb.repository.MongoRepository
|
||||||
|
|
||||||
// TODO: figure out what ID type should be
|
interface BahnStationRepository : MongoRepository<BahnStation, ObjectId> {
|
||||||
interface BahnStationRepository : MongoRepository<BahnStation, String>
|
fun findByEva(eva: Eva): BahnStation?
|
||||||
|
}
|
||||||
|
|||||||
+6
-1
@@ -1,7 +1,12 @@
|
|||||||
package de.twomartens.timetable.bahnApi.repository
|
package de.twomartens.timetable.bahnApi.repository
|
||||||
|
|
||||||
|
import de.twomartens.timetable.bahnApi.model.Eva
|
||||||
import de.twomartens.timetable.bahnApi.model.db.BahnTimetable
|
import de.twomartens.timetable.bahnApi.model.db.BahnTimetable
|
||||||
|
import de.twomartens.timetable.types.HourAtDay
|
||||||
|
import org.bson.types.ObjectId
|
||||||
import org.springframework.data.mongodb.repository.MongoRepository
|
import org.springframework.data.mongodb.repository.MongoRepository
|
||||||
|
|
||||||
// TODO: figure out what ID type should be
|
// TODO: figure out what ID type should be
|
||||||
interface BahnTimetableRepository : MongoRepository<BahnTimetable, String>
|
interface BahnTimetableRepository : MongoRepository<BahnTimetable, ObjectId> {
|
||||||
|
fun findByEvaAndHourAtDay(eva: Eva, hourAtDay: HourAtDay): BahnTimetable?
|
||||||
|
}
|
||||||
+6
-2
@@ -1,7 +1,11 @@
|
|||||||
package de.twomartens.timetable.bahnApi.repository
|
package de.twomartens.timetable.bahnApi.repository
|
||||||
|
|
||||||
|
import de.twomartens.timetable.bahnApi.model.Eva
|
||||||
import de.twomartens.timetable.bahnApi.model.db.ScheduledFetchTask
|
import de.twomartens.timetable.bahnApi.model.db.ScheduledFetchTask
|
||||||
|
import de.twomartens.timetable.types.HourAtDay
|
||||||
|
import org.bson.types.ObjectId
|
||||||
import org.springframework.data.mongodb.repository.MongoRepository
|
import org.springframework.data.mongodb.repository.MongoRepository
|
||||||
|
|
||||||
// TODO: what should be ID type be?
|
interface ScheduledFetchTaskRepository : MongoRepository<ScheduledFetchTask, ObjectId> {
|
||||||
interface ScheduledFetchTaskRepository : MongoRepository<ScheduledFetchTask, String>
|
fun findByEvaAndFetchedDateTime(eva: Eva, fetchedDateTime: HourAtDay): ScheduledFetchTask?
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user