我正在关注Ignite高速缓存中正在运行的SQL查询的代码,但能够完全实现CacheConfiguration.setIndexedTypes API的使用。如何将CacheConfiguration.setIndexedTypes用于Ignite高速缓存
我追随着我在点火网站找到的唯一帮助。
文档here说,使用 CacheConfiguration.setIndexedTypes(MyKey.class,MyValue.class)。
现在,让我们在Person类
@QuerySqlField(index = true)
private long id;
@QuerySqlField
private String firstName;
它们是我的参数应该是传入setIndexedType方法说呢?
所以在情况下,可以说我对类人 @QuerySqlField(指数=真) 私人长期ID两个指标; @QuerySqlField(index = true) private String orgId; 我的索引类型应该是 - cacheConfig.setIndexedTypes(Long.class,Person.class,String.class,Person.class); 这是正确的吗? – frewper
@frewper不,实际上键类型不依赖索引。即使您将其他字段编入索引,setIndexedTypes调用也将保持不变。我添加了一些关于它的信息给我的答案。 – Denis