package com.ksfe.auditlog.repository;
import org.springframework.data.cassandra.repository.CassandraRepository;
import com.ksfe.auditlog.model.Customer;
public interface CustomerRepository extends CassandraRepository<Customer> {
}
,其中错误显示为 类型CassandraRepository的参数数目不正确;不能使用参数
对其进行参数化答案 0 :(得分:0)
更改此
public interface CustomerRepository extends CassandraRepository<Customer>
到
public interface CustomerRepository extends CassandraRepository<Customer,Integer>
也通过添加id参数。
注意:整数/长整数取决于ID类型。
答案 1 :(得分:0)
更改spring boot和spring-data版本以匹配本文中使用的版本,或者在您的实体中添加第二个参数,其ID字段类型为
public interface CustomerRepository extends CassandraRepository<Customer,Long> {}
从2.0.0版开始,大多数spring数据存储库都有两个参数。