Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package org.molgenis.data;
import java.util.Set;
import java.util.stream.Stream;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.molgenis.data.aggregation.AggregateQuery;
import org.molgenis.data.aggregation.AggregateResult;
import org.molgenis.data.meta.MetaDataService;
import org.molgenis.data.meta.model.EntityType;
/**
* DataService is a facade that manages data sources Entity names should be unique over all data
* sources.
*
*
Main entry point for the DataApi
*/
public interface DataService extends Iterable> {
void setMetaDataService(MetaDataService metaDataService);
/**
* Get the MetaDataService
*
* @return meta data service
*/
MetaDataService getMeta();
/**
* Get the capabilities of a repository
*
* @param repositoryName repository name
* @return repository capabilities
*/
Set getCapabilities(String repositoryName);
/**
* Returns whether a repository exists for the given entity type identifier.
*
* @param entityTypeId entity type identifier
* @return true if a repository exists for the given entity type identifier
*/
boolean hasRepository(String entityTypeId);
/**
* Returns the repository for the given entity type identifier.
*
* @param entityTypeId entity type identifier
* @return repository, never null
* @throws UnknownEntityTypeException if no entity type with the given identifier exists
* @throws UnknownRepositoryException if no repository exists for the entity type
*/
Repository getRepository(String entityTypeId);
/**
* Returns the typed repository for the given entity type identifier.
*
* @param entityTypeId entity type identifier
* @param entityTypeClass entity type class
* @return typed repository, never null
* @throws UnknownEntityTypeException if no entity type with the given identifier exists
* @throws UnknownRepositoryException if no repository exists for the entity type
*/
Repository getRepository(String entityTypeId, Class entityTypeClass);
/**
* Returns whether an entity type exists for the given entity type identifier.
*
* @param entityTypeId entity type identifier
* @return true if an entity type exists for the given entity type identifier
*/
boolean hasEntityType(String entityTypeId);
/**
* Returns the entity type for the given entity type identifier.
*
* @param entityTypeId entity type identifier
* @return entity type, never null
* @throws UnknownEntityTypeException if no entity type with the given identifier exists
*/
EntityType getEntityType(String entityTypeId);
/**
* Returns the number of entities of the given type.
*
* @param entityTypeId entity name
* @return number of entities
*/
long count(String entityTypeId);
/**
* return number of entities matched by query
*
* @throws MolgenisDataException if the repository of the entity isn't a Queryable
*/
long count(String entityTypeId, Query q);
/**
* Find all entities of the given type. Returns empty Stream if no matches.
*
* @throws MolgenisDataException if the repository of the entity isn't a Queryable
*/
Stream findAll(String entityTypeId);
/** type-safe find all entities */
Stream findAll(String entityTypeId, Class clazz);
/**
* Find entities that match a query. Returns empty stream if no matches.
*
*
throws MolgenisDataException if the repository of the entity isn't a Queryable
*/
Stream findAll(String entityTypeId, Query q);
/**
* Type-safe find entities that match a query
*
* @param q query
* @param clazz entity class
*/
Stream findAll(String entityTypeId, Query q, Class clazz);
/**
* Finds all entities with the given IDs. Returns empty stream if no matches.
*
* @param ids entity ids
* @return (empty) Stream where the order of entities matches the order of ids, never null
*/
Stream findAll(String entityTypeId, Stream