我正在使用@FetchGroup加载类别数据,每个类别可能有也可能没有父/子类别。
*我只需要两个级别的数据,这意味着类别-> sub level1 -> sub级别2*我不想获取类别的完整尝试,因为这会影响性能。我在实体类中添加了@FetchGroup(name = FetchGroupConstants.CATEGORY_CHILD_LEVEL_2, attributes = { @FetchAttribute(name = "children", recursionDepth = 2) })。然后,我还使用以下组来获取数据
@FetchGroup(name = FetchGroupConstants.CATEGORY_BASIC, attributes = { @FetchAttribute(name = "ordering"), @FetchAttribute(name = "catalog") }),
然后我得到了完整的树。结果与"recursionDepth = -1“相同。如果我设置recursionDepth = 1,我也会得到完整的树。我在用"FetchPlan“,有什么问题吗?谢谢。
发布于 2013-06-22 07:05:18
放弃吧。我现在使用的是将整个树放到服务器的缓存中。任何建议。
https://stackoverflow.com/questions/17218076
复制相似问题