Spring Cassandra 模型映射
Spring Cassandra model mapping
我有一个 table 如下
col1 text,
col2 timestamp,
col3 text,
col4 text,
col5 text,
col6 date,
col7 time,
我不知道如何为上面的 table 创建一个 bean class。
到目前为止,我已经使用以下键创建了一个 bean。但是不行
@PrimaryKey
String col1;
Date col2;
String col3;
String col4;
String col5;
Date col6;
String col6;
请帮助我处理 Spring 中的 timestamp
、time
和 date
等 Cassandra 数据类型。
┌───────────┬────────────────────────────────────────┐
│ timestamp │ java.util.Date │
├───────────┼────────────────────────────────────────┤
│ date │ com.datastax.driver.core.LocalDate │
├───────────┼────────────────────────────────────────┤
│ time │ long │
└───────────┴────────────────────────────────────────┘
1. Spring Data for Apache Cassandra - 13.1. Data Mapping and Type Conversion
2。 Java Driver for Apache Cassandra - CQL to Java type mapping
我有一个 table 如下
col1 text,
col2 timestamp,
col3 text,
col4 text,
col5 text,
col6 date,
col7 time,
我不知道如何为上面的 table 创建一个 bean class。 到目前为止,我已经使用以下键创建了一个 bean。但是不行
@PrimaryKey
String col1;
Date col2;
String col3;
String col4;
String col5;
Date col6;
String col6;
请帮助我处理 Spring 中的 timestamp
、time
和 date
等 Cassandra 数据类型。
┌───────────┬────────────────────────────────────────┐
│ timestamp │ java.util.Date │
├───────────┼────────────────────────────────────────┤
│ date │ com.datastax.driver.core.LocalDate │
├───────────┼────────────────────────────────────────┤
│ time │ long │
└───────────┴────────────────────────────────────────┘
1. Spring Data for Apache Cassandra - 13.1. Data Mapping and Type Conversion
2。 Java Driver for Apache Cassandra - CQL to Java type mapping