I'm getting an error in my implicit reader when I create an implicit reader for an entity that has an attribute that is of type instant and cardinality many, which I'm pretty sure is a bug. Here's an example of a class with a singular date that works fine:
case class AppointmentRequest(title: String, proposedTime: Date)
object AppointmentRequest {
object Schema {
object ns {
val appointmentRequest = new Namespace("appointmentRequest")
}
val title = Attribute(ns.appointmentRequest / "title",
SchemaType.string,
Cardinality.one)
val proposedTime = Attribute(ns.appointmentRequest / "proposedTime",
SchemaType.instant,
Cardinality.one)
}
implicit val reader = (
Schema.title.read[String] and
Schema.proposedTime.read[java.util.Date]
)(AppointmentRequest.apply _)
}
But if I change proposedTime to have a Cardinality.many...
case class AppointmentRequest(title: String, proposedTime: Set[Date])
object AppointmentRequest {
object Schema {
object ns {
val appointmentRequest = new Namespace("appointmentRequest")
}
val title = Attribute(ns.appointmentRequest / "title",
SchemaType.string,
Cardinality.one)
val proposedTime = Attribute(ns.appointmentRequest / "proposedTime",
SchemaType.instant,
Cardinality.many)
}
implicit val reader = (
Schema.title.read[String] and
Schema.proposedTime.read[Date]
)(AppointmentRequest.apply _)
}
It gives the following error:
[error] /.../AppointmentRequest.scala:29: There is no type-casting reader for type java.util.Date given an attribute with Datomic type java.util.Date and cardinality datomisca.Cardinality.many.type to type java.util.Date
[error] Schema.proposedTime.read[Date]
[error] ^
I'm getting an error in my implicit reader when I create an implicit reader for an entity that has an attribute that is of type
instant
and cardinalitymany
, which I'm pretty sure is a bug. Here's an example of a class with a singular date that works fine:But if I change proposedTime to have a Cardinality.many...
It gives the following error: