0

我想知道这在 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); 
4

1 回答 1

1

阿尔弗雷德·萨拉赫

这将起作用

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

有关此处此处的嵌套索引的更多信息

如果您有任何问题,请告诉我。

干杯,维克

于 2016-11-07T15:03:00.590 回答