Cassandraデータベースを使用しているスプリングブートデータに関連するヘルプを探しています。
私のpom.xmlに次の依存関係があります。springbootデータを使用してcassandraにユーザーデータ型をマッピングする方法
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-boot-starter-data-cassandra</artifactId>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
<version>2.1.10.3</version>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-mapping</artifactId>
<version>2.1.10.3</version>
</dependency>
The table structure looks like:
@Table(value = "TEST_ORDERS")
public class OrderDTO {
@PrimaryKey
@Column(value = "email")
private String emailId;
@Column(value = "order_id")
private int orderId;
@Column(value = "creation_date")
private Timestamp creationDate;
@Column(value = "discount_total")
private double discountTotal;
@Column(name = "shipments")
//This is a UDT type
private Set<ShippingDetails> shipments;
//getters and setters here
}
The ShippingDetails object is a UDT with following declartion and i defined as a frozen collection in the cassandra CQL sripts
@UDT(name = "shipping", keyspace = "mc_checkout")
public class ShippingDetails {
@Field(name = "name")
private FullName name;
@Field(name = "quantity_shipped")
private int quantityShipped;
@Field(name = "shipping_address")
private CheckoutAddress shippingAddress;
//so on
}
There is a repository created for the basic CRUD operations:
@Repository
public interface OrderRepository extends CrudRepository<OrderDTO, String> {
}
When i try to invoke findOne API of this repository in my Service class
私はエラーの下に取得:ApacheのカサンドラとDatastax」マッピングの カサンドラ実体は@Table、@Persistentまたは@PrimaryKeyClass注釈を持っている必要があります