You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Data Cassandra与Solr冲突:实体双注解引发PropertyReferenceException异常

Spring Data冲突:同时标注@Table(Cassandra)与@SolrDocument时抛出PropertyReferenceException

各位大佬好,我这边碰到个头疼的问题:公司项目要给Cassandra数据库(用DataStax集群搭建)加上搜索能力,同时用Spring Data来简化数据库操作。

但当我给实体类同时加上@Table(用于Cassandra映射)和@SolrDocument(用于Solr索引)注解后,项目启动直接抛出异常,核心错误提示如下:

Caused by: org.springframework.data.mapping.PropertyReferenceException: No property findAll found for type ENTITYNAME!

我大概能判断这是Spring Data相关的冲突问题,但试了几种思路都没搞定,想请教下有没有遇到过同类问题的朋友给点方向?

引发问题的实体类示例代码如下:

@SolrDocument(solrCoreName = "sample_entity")
@Table("sample_entity")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public final class SampleEntity {
    @PrimaryKey
    @Indexed(name = "id")
    private UUID id;
    private LocalDateTime created;
    private UUID foreignId;
    @Indexed(name = "name")
    private String name;
    private boolean someflag = true;
}

内容的提问来源于stack exchange,提问作者艁ukaszG

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 06:28:18