/* (non-Javadoc)
@see io.jsondb.JsonDBOperations#findAll(java.lang.Class)
514597
@Override
  public <T> List<T> findAll(Class<T> entityClass) {
    return findAll(Util.determineCollectionName(entityClass));
  }
248352
@Override
    public Iterable<T> findAll(EntityFilter<T> filter) {
        List<T> results = new ArrayList<>();
        for (T object : findAll()) {
            if (filter.accept(object)) {
                results.add(object);
            }
        }
        return results;
    }
916815
@Override
    public Iterable<T> findAll(Iterable<I> ids) {
        List<T> results = new ArrayList<>();
        for (I id : ids) {
            T t = findOne(id);
            if (t != null) {
                results.add(t);
            }
        }
        return results;
    }
546091
@Override
    public <E> List<E> findAll(Class<E> entityClass, String[] columnsToSelect, Object... keys)
    {
        List<E> results = new ArrayList<E>();

        if (columnsToSelect == null)
        {
            columnsToSelect = new String[0];
        }

        if (keys == null)
        {
            EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClass);
            MetamodelImpl metamodel = (MetamodelImpl) KunderaMetadataManager.getMetamodel(kunderaMetadata,
                    entityMetadata.getPersistenceUnit());

            EntityType entityType = metamodel.entity(entityMetadata.getEntityClazz());

            Table schemaTable = tableAPI.getTable(entityMetadata.getTableName());
            // KunderaCoreUtils.showQuery("Get all records for " +
            // entityMetadata.getTableName(), showQuery);
            Iterator<Row> rowsIter = tableAPI.tableIterator(schemaTable.createPrimaryKey(), null, null);

            Map<String, Object> relationMap = initialize(entityMetadata);

            try
            {
                results = scrollAndPopulate(null, entityMetadata, metamodel, schemaTable, rowsIter, relationMap,
                        Arrays.asList(columnsToSelect));
            }
            catch (Exception e)
            {
                log.error("Error while finding records , Caused By :" + e + ".");
                throw new PersistenceException(e);
            }
        }
        else
        {

            for (Object key : keys)
            {
                results.add((E) find(entityClass, key, Arrays.asList(columnsToSelect)));
            }
        }

        return results;
    }
367793
public String findAll(final Class<?> clazz) {
    return new SQL() {
      {
        SELECT("*");
        FROM(EntityUtil.getTableName(clazz));
      }
    }.toString();
  }
846501
@Override
	public ResourceList<T> findAll(Iterable<I> ids, QuerySpec querySpec) {
		RegistryEntry entry = resourceRegistry.findEntry(resourceClass);
		String idName = entry.getResourceInformation().getIdField().getUnderlyingName();

		QuerySpec idQuerySpec = querySpec.duplicate();
		idQuerySpec.addFilter(new FilterSpec(Arrays.asList(idName), FilterOperator.EQ, ids));
		return findAll(idQuerySpec);
	}
876813
public @NotNull <T> List<T> findAll(@NotNull Class<T> cl, @NotNull @SQL String sql, Object... args) {
        return findAll(cl, SqlQuery.query(sql, args));
    }
575806
@Help(help = "Find all the objects of type {#}")
  public List<T> findAll() throws SDKException {
    return Arrays.asList((T[]) requestGet(null, clazz));
  }
689336
public static boolean allJSONObjects(JSONArray array) throws JSONException {
        for (int i = 0; i < array.length(); ++i) {
            if (!(array.get(i) instanceof JSONObject)) {
                return false;
            }
        }
        return true;
    }
155470
public List<T> findAll() {
        if (cache && cachedObjects != null) {
            return cachedObjects;
        }

        List<String> ids = getObjectList();

        List<T> listT = new ArrayList<>();

        for (String id : ids) {
            listT.add(find(id));
        }

        if (cache) {
            cachedObjects = listT;
        }

        return listT;
    }
115432
public <T> ESDatas<T> searchAll(String index,  Class<T> type) throws ElasticSearchException{

		return searchAll(  index,    DEFAULT_FETCHSIZE , type) ;

	}
779957
@Override
    public final <E> List<E> findAll(Class<E> entityClass, String[] columnsToSelect, Object... rowIds) {
        // TODO: need to think about selected column case.
        // Bring in IN Clause in place of each read.

        List results = new ArrayList<E>();
        if (rowIds != null) {
            for (Object rowId : rowIds) {
                Object result = find(entityClass, rowId);
                if (result != null) {
                    results.add(result);
                }
            }
        }
        return results;
    }
350258
@Override
    public Object find(Class entityClass, Object key)
    {

        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClass);
        JsonDocument doc;
        String id = generateJsonDocId(entityMetadata.getTableName(), key.toString());
        doc = bucket.get(id);
        LOGGER.debug("Found result for ID : " + key.toString() + " in the " + bucket.name() + " Bucket");

        if (doc == null)
        {
            return null;
        }
        else
        {
            MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
                    .getMetamodel(entityMetadata.getPersistenceUnit());
            EntityType entityType = metaModel.entity(entityMetadata.getEntityClazz());
            return handler.getEntityFromDocument(entityClass, doc.content(), entityType);
        }
    }
1206202
@Override
	public <S extends T> Page<S> findAll(final Example<S> example, final Pageable pageable) {
		final ArangoCursor cursor = findAllInternal(pageable, example, new HashMap());
		final List<T> content = cursor.asListRemaining();
		return new PageImpl<>((List<S>) content, pageable, cursor.getStats().getFullCount());
	}
831007
public static <T> Stream<T> findAll(Class<T> clazz) {
    ServiceLoader<T> load = ServiceLoader.load(clazz);
    return StreamSupport.stream(load.spliterator(), false);
  }
774905
@Override
  public Stream<Entity> findAll(Query<Entity> q) {
    Stream<Entity> entities = delegate().findAll(q);
    return resolveEntityReferences(entities, q.getFetch());
  }
1117582
public static List<Map> findAll(String query) {
        return new DB(DB.DEFAULT_NAME).findAll(query);
    }