diff --git a/src/main/java/com/uci/dao/models/XMessageDAO.java b/src/main/java/com/uci/dao/models/XMessageDAO.java index f16abdb..5345fd8 100644 --- a/src/main/java/com/uci/dao/models/XMessageDAO.java +++ b/src/main/java/com/uci/dao/models/XMessageDAO.java @@ -8,6 +8,11 @@ import org.springframework.data.cassandra.core.mapping.PrimaryKeyColumn; import org.springframework.data.cassandra.core.mapping.Table; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; + import java.io.Serializable; import java.time.LocalDateTime; import java.util.UUID; @@ -33,6 +38,9 @@ public class XMessageDAO implements Serializable { private String channel; @Column private String provider; + + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) @PrimaryKeyColumn(type = CLUSTERED, ordering = Ordering.DESCENDING) private LocalDateTime timestamp; @Column