Returns a list of entities.
@param type
@param searchSourceBuilder
@throws StorageException
495119
private List<Hit<Map<String, Object>, Void>> listEntities(String type,
            SearchSourceBuilder searchSourceBuilder) throws StorageException {
        try {
            String query = searchSourceBuilder.string();
            Search search = new Search.Builder(query).addIndex(getIndexName()).addType(type).build();
            SearchResult response = esClient.execute(search);
            @SuppressWarnings({ "rawtypes", "unchecked" })
            List<Hit<Map<String, Object>, Void>> thehits = (List) response.getHits(Map.class);
            return thehits;
        } catch (Exception e) {
            throw new StorageException(e);
        }
    }
987159
public static EntityType checkIsEntityType(Type type) {
        if (!isEntityType(type)) {
            throw new ODataSystemException("An entity type is required, but '" + type.getFullyQualifiedName() +
                    "' is not an entity type: " + type.getMetaType());
        }
        return (EntityType) type;
    }
997281
@Override
    public List<JsonEntityBean> getEntityBeans(List<String> params) {
        // if no parameters have been supplied, just return an empty list
        if (params == null || params.isEmpty()) {
            return Collections.<JsonEntityBean>emptyList();
        }

        List<JsonEntityBean> beans = new ArrayList<JsonEntityBean>();
        for (String param : params) {
            String[] parts = param.split(":", 2);
            JsonEntityBean member = getEntity(parts[0], parts[1], false);
            beans.add(member);
        }
        return beans;
    }
405305
private void updateEntity(String type, String id, XContentBuilder source) throws StorageException {
        try {
            String doc = source.string();
            /* JestResult response = */esClient.execute(new Index.Builder(doc)
                    .setParameter(Parameters.OP_TYPE, "index").index(getIndexName()).type(type).id(id).build()); //$NON-NLS-1$
        } catch (Exception e) {
            throw new StorageException(e);
        }
    }
1012118
public void add(String[] types, OsgiModelSource<?> source) {
        for (String resourceType : types) {
            this.typeNameToModelSourcesMap.put(resourceType, source);
        }
        clearLookupCaches();
    }
262171
public List<String> listEntities(final String entityType) throws AtlasServiceException {
        JSONObject jsonResponse = callAPIWithRetries(API.LIST_ENTITIES, null, new ResourceCreator() {
            @Override
            public WebResource createResource() {
                WebResource resource = getResource(API.LIST_ENTITIES);
                resource = resource.queryParam(TYPE, entityType);
                return resource;
            }
        });
        return extractResults(jsonResponse, AtlasClient.RESULTS, new ExtractOperation<String, String>());
    }
1008221
@Override
    public IterableResult<Extension> search(ExtensionQuery query) throws SearchException
    {
        return RepositoryUtils.search(query, this.repositories);
    }
34201
def entities_of_type(type)
      @entities.select { |entity| entity['type'] == type }.map { |entity| Entity.new entity }
    end
811287
public List<String> getAllIdList(String index, String type) {
        return extractIdList(searchAll(index, type));
    }
862712
@Override
    public <E> List<E> findAll(Class<E> entityClass, String[] columnsToSelect, Object... keys)
    {
        Object connection = getConnection();
        List results = new ArrayList();
        try
        {
            for (Object key : keys)
            {
                Object result = fetch(entityClass, key, connection, null);
                if (result != null)
                {
                    results.add(result);
                }
            }
        }
        catch (InstantiationException e)
        {
            logger.error("Error during find by key:", e);
            throw new PersistenceException(e);
        }
        catch (IllegalAccessException e)
        {
            logger.error("Error during find by key:", e);
            throw new PersistenceException(e);
        }
        return results;
    }
713686
@Programmatic
    public List<DocumentTemplate> findByType(final DocumentType documentType) {
        return repositoryService.allMatches(
                new QueryDefault<>(DocumentTemplate.class,
                        "findByType",
                        "type", documentType));
    }
485319
private <T> SearchResultsBean<T> find(SearchCriteriaBean criteria, String type,
            IUnmarshaller<T> unmarshaller) throws StorageException {
        try {
            SearchResultsBean<T> rval = new SearchResultsBean<>();

            // Set some default in the case that paging information was not included in the request.
            PagingBean paging = criteria.getPaging();
            if (paging == null) {
                paging = new PagingBean();
                paging.setPage(1);
                paging.setPageSize(20);
            }
            int page = paging.getPage();
            int pageSize = paging.getPageSize();
            int start = (page - 1) * pageSize;

            SearchSourceBuilder builder = new SearchSourceBuilder().size(pageSize).from(start).fetchSource(true);

            // Sort order
            OrderByBean orderBy = criteria.getOrderBy();
            if (orderBy != null) {
                String name = orderBy.getName();
                if (name.equals("name") || name.equals("fullName")) { //$NON-NLS-1$ //$NON-NLS-2$
                    name += ".raw"; //$NON-NLS-1$
                }
                if (orderBy.isAscending()) {
                    builder.sort(name, SortOrder.ASC);
                } else {
                    builder.sort(name, SortOrder.DESC);
                }
            }

            // Now process the filter criteria
            List<SearchCriteriaFilterBean> filters = criteria.getFilters();

            QueryBuilder q = null;

            if (filters != null && !filters.isEmpty()) {
                FilterBuilder andFilter = FilterBuilders.filter();
                int filterCount = 0;
                for (SearchCriteriaFilterBean filter : filters) {
                    String propertyName = filter.getName();
                    if (filter.getOperator() == SearchCriteriaFilterOperator.eq) {
                        andFilter.add(FilterBuilders.termFilter(propertyName, filter.getValue()));
                        filterCount++;
                    } else if (filter.getOperator() == SearchCriteriaFilterOperator.like) {
                        q = QueryBuilders.wildcardQuery(propertyName, filter.getValue().toLowerCase().replace('%', '*'));
                    } else if (filter.getOperator() == SearchCriteriaFilterOperator.bool_eq) {
                        andFilter.add(FilterBuilders.termFilter(propertyName, "true".equals(filter.getValue()))); //$NON-NLS-1$
                        filterCount++;
                    }
                    // TODO implement the other filter operators here!
                }

                if (filterCount > 0) {
                    q = FilterBuilders.boolFilter(andFilter);
                }
            }
            builder.query(q);

            String query = builder.string();
            Search search = new Search.Builder(query)
                    .addIndex(getIndexName())
                    .addType(type)
                    .build();
            SearchResult response = esClient.execute(search);
            @SuppressWarnings({ "unchecked", "rawtypes" })
            List<Hit<Map<String, Object>, Void>> thehits = (List) response.getHits(Map.class);

            rval.setTotalSize((int)(long)response.getTotal());
            for (Hit<Map<String,Object>,Void> hit : thehits) {
                Map<String, Object> sourceAsMap = hit.source;
                T bean = unmarshaller.unmarshal(sourceAsMap);
                rval.getBeans().add(bean);
            }
            return rval;
        } catch (Exception e) {
            throw new StorageException(e);
        }
    }
648280
@SuppressWarnings("unchecked")
    public <T> List<T> getAll(Class<T> entityCls) {
        if (entityCls == null) {
            throw new IllegalArgumentException("entityCls cannot be null");
        }
        EntityManager entityManager = this.entityManagerProvider.get();
        CriteriaBuilder builder = entityManager.getCriteriaBuilder();
        CriteriaQuery<T> criteriaQuery
                = builder.createQuery(entityCls);
        criteriaQuery.from(entityCls);
        TypedQuery<T> typedQuery
                = entityManager.createQuery(criteriaQuery);
        List<T> results = typedQuery.getResultList();
        return results;
    }
1228741
@Override
    public EntityIdentifier[] searchForEntities(
            String query, IGroupConstants.SearchMethod method, Class type) throws GroupsException {
        Set allIds = new HashSet();

        for (Iterator services = getComponentServices().values().iterator(); services.hasNext(); ) {
            IIndividualGroupService service = (IIndividualGroupService) services.next();
            EntityIdentifier[] ids = service.searchForEntities(query, method, type);
            for (int i = 0; i < ids.length; i++) {
                allIds.add(ids[i]);
            }
        }
        return (EntityIdentifier[]) allIds.toArray(new EntityIdentifier[allIds.size()]);
    }
1210488
protected List<FileMeta> handleGetEntityMetaFiles(Class<? extends FileEntity> type, Integer entityId) {
        Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForGetEntityMetaFiles(
                BullhornEntityInfo.getTypesRestEntityName(type), entityId);
        String url = restUrlFactory.assembleGetEntityMetaFilesUrl();
        String jsonString = this.performGetRequest(url, String.class, uriVariables);
        EntityMetaFiles<? extends FileMeta> entityMetaFiles = restJsonConverter.jsonToEntityDoNotUnwrapRoot(jsonString,
                StandardEntityMetaFiles.class);
        if (entityMetaFiles == null || entityMetaFiles.getFileMetas() == null) {
            return Collections.emptyList();
        }
        return (List<FileMeta>) entityMetaFiles.getFileMetas();
    }
650631
public SearchResponse searchAll(String index, String type,
            QueryBuilder filterQueryBuilder) {
        return searchAll(index, type, filterQueryBuilder, null);
    }
465482
@Override
    public List<SearchResult> search(EntityMetadata m, String persistenceUnit, ConsistencyLevel consistencyLevel,
            Map<Boolean, List<IndexClause>> indexClauseMap)
    {

        return super.search(m, persistenceUnit, consistencyLevel, indexClauseMap);
    }