Package ubic.gemma.persistence.service
Interface BaseReadOnlyService<O extends Identifiable>
- All Known Subinterfaces:
AnalysisResultSetService<K,
,O> AnalysisService<T>
,AnnotationAssociationService
,ArrayDesignService
,AuditTrailService
,BaseImmutableService<O>
,BaseService<O>
,BaseVoEnabledService<O,
,VO> BibliographicReferenceService
,BioAssayDimensionService
,BioAssayService
,BioMaterialService
,BioSequenceService
,BlacklistedEntityService
,BlatAssociationService
,BlatResultService
,BulkExpressionDataVectorService<T>
,CharacteristicService
,ChromosomeService
,CoexpressionAnalysisService
,CompositeSequenceService
,CompoundService
,ContactService
,DatabaseEntryService
,DifferentialExpressionAnalysisService
,DifferentialExpressionResultService
,ExperimentalDesignService
,ExperimentalFactorService
,ExpressionAnalysisResultSetService
,ExpressionExperimentService
,ExpressionExperimentSetService
,ExpressionExperimentSubSetService
,ExternalDatabaseService
,FactorValueService
,FilteringService<O>
,FilteringVoEnabledService<O,
,VO> GeeqService
,Gene2GOAssociationService
,GeneDiffExMetaAnalysisService
,GeneProductService
,GeneService
,GeneSetService
,PrincipalComponentAnalysisService
,ProcessedExpressionDataVectorService
,ProtocolService
,QuantitationTypeService
,RawAndProcessedExpressionDataVectorService
,RawExpressionDataVectorService
,SecurableBaseImmutableService<C>
,SecurableBaseReadOnlyService<C>
,SecurableBaseService<C>
,SecurableBaseVoEnabledService<C,
,VO> SecurableFilteringVoEnabledService<C,
,VO> TaxonService
- All Known Implementing Classes:
AbstractBulkExpressionDataVectorService
,AbstractFilteringVoEnabledService
,AbstractService
,AbstractVoEnabledService
,AnnotationAssociationServiceImpl
,ArrayDesignServiceImpl
,AuditTrailServiceImpl
,BibliographicReferenceServiceImpl
,BioAssayDimensionServiceImpl
,BioAssayServiceImpl
,BioMaterialServiceImpl
,BioSequenceServiceImpl
,BlacklistedEntityServiceImpl
,BlatAssociationServiceImpl
,BlatResultServiceImpl
,CharacteristicServiceImpl
,ChromosomeServiceImpl
,CoexpressionAnalysisServiceImpl
,CompositeSequenceServiceImpl
,CompoundServiceImpl
,ContactServiceImpl
,DatabaseEntryServiceImpl
,DifferentialExpressionAnalysisServiceImpl
,DifferentialExpressionResultServiceImpl
,ExperimentalDesignServiceImpl
,ExperimentalFactorServiceImpl
,ExpressionAnalysisResultSetServiceImpl
,ExpressionExperimentServiceImpl
,ExpressionExperimentSetServiceImpl
,ExpressionExperimentSubSetServiceImpl
,ExternalDatabaseServiceImpl
,FactorValueServiceImpl
,GeeqServiceImpl
,Gene2GOAssociationServiceImpl
,GeneDiffExMetaAnalysisServiceImpl
,GeneProductServiceImpl
,GeneServiceImpl
,GeneSetServiceImpl
,PrincipalComponentAnalysisServiceImpl
,ProcessedExpressionDataVectorServiceImpl
,ProtocolServiceImpl
,QuantitationTypeServiceImpl
,RawAndProcessedExpressionDataVectorServiceImpl
,RawExpressionDataVectorServiceImpl
,TaxonServiceImpl
public interface BaseReadOnlyService<O extends Identifiable>
Interface for read-only services.
- Author:
- poirigui
-
Method Summary
Modifier and TypeMethodDescriptionlong
countAll()
Does a search for the entity in the persistent storagefindOrFail
(O entity) Does a search for the entity in the persistent storage, raising aNullPointerException
if not found.Loads object with given ID.load
(Collection<Long> ids) Loads objects with given ids.loadAll()
Loads all the entities of specific type.loadOrFail
(Long id) Convenience for runningload(Long)
and checking if the result is null.loadOrFail
(Long id, Function<String, T> exceptionSupplier) Load an entity or fail with the supplied exception; the message is generated automatically.loadOrFail
(Long id, Function<String, T> exceptionSupplier, String message) Load an entity or fail with the supplied exception and message.loadOrFail
(Long id, Supplier<T> exceptionSupplier) Load an entity or fail with the supplied exception.streamAll
(boolean createNewSession)
-
Method Details
-
getElementClass
-
find
Does a search for the entity in the persistent storage- Parameters:
entity
- the entity to be searched for- Returns:
- the version of entity retrieved from the persistent storage, if found, otherwise null.
-
findOrFail
Does a search for the entity in the persistent storage, raising aNullPointerException
if not found.- Parameters:
entity
- the entity to be searched for- Returns:
- the version of entity retrieved from persistent storage
- Throws:
NullPointerException
- if the entity is not found
-
load
Loads objects with given ids.- Parameters:
ids
- the ids of objects to be loaded.- Returns:
- collection containing object with given IDs.
-
load
Loads object with given ID.- Parameters:
id
- the ID of entity to be loaded.- Returns:
- the entity with matching ID, or null if the entity does not exist or if the passed ID was null
-
loadOrFail
Convenience for runningload(Long)
and checking if the result is null.- Parameters:
id
- the ID used to retrieve the entity- Returns:
- the entity as per
load(Long)
, never null - Throws:
NullPointerException
- if the entity does not exist in the persistent storage
-
loadOrFail
Load an entity or fail with the supplied exception.- Throws:
T
- if the entity does not exist in the persistent storage
-
loadOrFail
Load an entity or fail with the supplied exception; the message is generated automatically.- Throws:
T
- if the entity does not exist in the persistent storage
-
loadOrFail
@Nonnull <T extends Exception> O loadOrFail(Long id, Function<String, T> exceptionSupplier, String message) throws TLoad an entity or fail with the supplied exception and message.- Throws:
T
- if the entity does not exist in the persistent storage
-
loadAll
Collection<O> loadAll()Loads all the entities of specific type.- Returns:
- collection of all entities currently available in the persistent storage.
-
countAll
long countAll() -
streamAll
-
streamAll
-