Matthew Adams
06/18/2021, 8:03 PM2021.0.1
support Kotlin 1.5
? The docs at https://docs.spring.io/spring-data/mongodb/docs/3.2.1/reference/html/#kotlin.requirements say Spring Data supports Kotlin 1.3...
Matthew Adams
06/18/2021, 8:09 PMdata class
from Mongo due to the presence of the final parameter of the constructor being of type `kotlin.jvm.internal.DefaultConstructorMarker`: I get an exception org.springframework.data.mapping.MappingException: Parameter org.springframework.data.mapping.PreferredConstructor$Parameter@80a6e44c does not have a name!
. The parameter in question is, indeed, the DefaultConstructorMarker
. I'm using Spring Data MongoDB 3.2.1
w/commons 2.5.1
.Matthew Adams
06/18/2021, 8:11 PMdata class
is :
sealed interface Availability {
companion object {
val CONVENTIONAL_8TO5_WITH_LUNCH_RECURRENCE: CronString = "0/30 8-12,13-17 * * MON-FRI"
val CONVENTIONAL_8TO5_RECURRENCE: CronString = "0/30 8-17 * * MON-FRI"
val CONVENTIONAL_9TO5_WITH_LUNCH_RECURRENCE: CronString = "0/30 9-12,13-17 * * MON-FRI"
val CONVENTIONAL_9TO5_RECURRENCE: CronString = "0/30 9-17 * * MON-FRI"
val DEFAULT_RECURRENCE = CONVENTIONAL_9TO5_WITH_LUNCH_RECURRENCE
val DEFAULT_SLOT_MINUTES = 30U.toUByte()
val DEFAULT_ALLOWED_BOOKING_COUNT = 1U.toUByte()
}
val handle: String
val slotMinutes: UByte
val allowedBookingCount: UByte
val name: String?
val effectivity: Interval?
}
data class RecurringAvailability(
val recurrence: CronString = DEFAULT_RECURRENCE,
override val handle: String = UUID.randomUUID().toString(),
override val slotMinutes: UByte = DEFAULT_SLOT_MINUTES,
override val allowedBookingCount: UByte = DEFAULT_ALLOWED_BOOKING_COUNT,
override val effectivity: Interval? = null,
override val name: String? = null,
) : Availability
(fyi, CronString
is typealias CronString = String
)Matthew Adams
06/19/2021, 2:38 PM