use of org.codelibs.fess.es.config.exbhv.LabelToRoleBhv in project fess by codelibs.
the class LabelType method getRoleTypeList.
public List<RoleType> getRoleTypeList() {
if (roleTypeList == null) {
synchronized (this) {
if (roleTypeList == null) {
final FessConfig fessConfig = ComponentUtil.getFessConfig();
final LabelToRoleBhv labelToRoleBhv = ComponentUtil.getComponent(LabelToRoleBhv.class);
final ListResultBean<LabelToRole> mappingList = labelToRoleBhv.selectList(cb -> {
cb.query().setLabelTypeId_Equal(getId());
cb.specify().columnRoleTypeId();
cb.paging(fessConfig.getPageRoletypeMaxFetchSizeAsInteger().intValue(), 1);
});
final List<String> roleIdList = new ArrayList<>();
for (final LabelToRole mapping : mappingList) {
roleIdList.add(mapping.getRoleTypeId());
}
final RoleTypeBhv roleTypeBhv = ComponentUtil.getComponent(RoleTypeBhv.class);
roleTypeList = roleIdList.isEmpty() ? Collections.emptyList() : roleTypeBhv.selectList(cb -> {
cb.query().setId_InScope(roleIdList);
cb.query().addOrderBy_SortOrder_Asc();
cb.fetchFirst(fessConfig.getPageRoletypeMaxFetchSizeAsInteger());
});
}
}
}
return roleTypeList;
}
Aggregations