Skip to content

Commit

Permalink
redis related serialization changes
Browse files Browse the repository at this point in the history
  • Loading branch information
surabhi-mahawar committed Mar 24, 2022
1 parent 5ea907a commit b433944
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/uci/dao/models/XMessageDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit b433944

Please sign in to comment.