private List<? extends ResourceTag> searchResourceTags(List<String> resourceIds, ResourceObjectType resourceType) { List<String> resourceUuids = resourceIds.stream().map(resourceId -> getUuid(resourceId, resourceType)).collect(Collectors.toList()); SearchBuilder<ResourceTagVO> sb = _resourceTagDao.createSearchBuilder(); sb.and("resourceUuid", sb.entity().getResourceUuid(), SearchCriteria.Op.IN); sb.and("resourceType", sb.entity().getResourceType(), SearchCriteria.Op.EQ); SearchCriteria<ResourceTagVO> sc = sb.create(); sc.setParameters("resourceUuid", resourceUuids.toArray()); sc.setParameters("resourceType", resourceType); return _resourceTagDao.search(sc, null); }
public ResourceTagsDaoImpl() { AllFieldsSearch = createSearchBuilder(); AllFieldsSearch.and("resourceId", AllFieldsSearch.entity().getResourceId(), Op.EQ); AllFieldsSearch.and("uuid", AllFieldsSearch.entity().getResourceUuid(), Op.EQ); AllFieldsSearch.and("resourceType", AllFieldsSearch.entity().getResourceType(), Op.EQ); AllFieldsSearch.and("key", AllFieldsSearch.entity().getKey(), Op.EQ); AllFieldsSearch.and("resourceUuid", AllFieldsSearch.entity().getResourceUuid(), Op.EQ); AllFieldsSearch.done(); }