我需要使用相同的列作为聚类列和二级索引。但是阿基里斯的编译失败了。
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(table="users")
public class Users{
@PartitionKey
@Column
private String userID;
@Index(name = "fname")
@ClusteringColumn
@Column
private String fname;
}
但编译器抛出错误如下:
[ERROR] /D:/Work/Codebase/itam-common/schema/target/generated-sources/annotations/info/archinnov/achilles/generated/dsl/Users_SelectIndex.java:[466,44] method fname() is already defined in class info.archinnov.achilles.generated.dsl.Users_SelectIndex.E
我使用的是achilles-core:5.3.1和cassandra-driver-core:3.3.0
答案 0 :(得分:0)
尝试为@Column
和@Index
注释提供不同的名称:
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(table="users")
public class Users{
...
@Index(name = "fname_idx")
@ClusteringColumn
@Column(name = "fname")
private String fname;
...
}