Hazelcast - 对象字段/属性的索引

时间:2016-11-07 11:02:56

标签: hazelcast hazelcast-imap

我想知道这是否可能在Hazelcast中实现。假设我们有一个Java实体:

public class BrtWeekDefinitions {

private Long id;
private BrtTimeCharts brtTimeCharts;
private BrtDayDefinitions brtDayDefinitions;
private Long weekDay;
}

此实体在内存中加载类型为:Long,BrtWeekDefinitions。

BrtTimeCharts和BrtDayDefinitions实体也会加载到各自的地图中。

这会起作用吗?

//Where mapObject is a map of type <Long,BrtWeekDefinitions>
mapObject.addIndex("BrtTimeCharts.id", false); 
mapObject.addIndex("BrtDayDefinitions.id", false);

或者我必须这样做吗?

//Where mapObject is a map of type <Long,BrtTimeCharts>
mapObject.addIndex("id", false); 

//Where mapObject is a map of type <Long,BrtDayDefinitions>
mapObject.addIndex("id", false); 

1 个答案:

答案 0 :(得分:1)

Alfred Salah,

这将有效

//Where mapObject is a map of type <Long,BrtWeekDefinitions>
mapObject.addIndex("brtTimeCharts.id", false); // use property name not type
mapObject.addIndex("brtDayDefinitions.id", false);

有关嵌套索引herehere

的详细信息

如果您有任何问题,请与我们联系。

干杯, 维克