Interface MetadataEntryRepository
-
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<MetadataEntry,java.lang.Long>
,IridaJpaRepository<MetadataEntry,java.lang.Long>
,org.springframework.data.jpa.repository.JpaSpecificationExecutor<MetadataEntry>
,MetadataEntryRepositoryCustom
,org.springframework.data.repository.PagingAndSortingRepository<MetadataEntry,java.lang.Long>
,org.springframework.data.repository.Repository<MetadataEntry,java.lang.Long>
,org.springframework.data.repository.history.RevisionRepository<MetadataEntry,java.lang.Long,java.lang.Integer>
public interface MetadataEntryRepository extends IridaJpaRepository<MetadataEntry,java.lang.Long>, MetadataEntryRepositoryCustom
Repository for saving and readingMetadataEntry
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Long
getMetadataEntriesCountBySamplesAndField(MetadataTemplateField field, java.util.List<Sample> sampleList)
MetadataEntry
getMetadataEntryById(java.lang.Long id)
Get theMetadataEntry
by idMetadataEntry
getMetadataEntryBySampleAndField(MetadataTemplateField field, Sample sample)
java.util.Set<MetadataEntry>
getMetadataForSample(Sample sample)
Get all theMetadataEntry
attached to the givenSample
java.util.Set<MetadataEntry>
getMetadataForSampleAndField(Sample sample, java.util.Collection<MetadataTemplateField> fields)
-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAll
-
Methods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
count, exists, findAll, findAll, findAll, findOne
-
Methods inherited from interface ca.corefacility.bioinformatics.irida.repositories.sample.MetadataEntryRepositoryCustom
getMetadataForProjectSamples
-
-
-
-
Method Detail
-
getMetadataForSample
@Query("FROM MetadataEntry m WHERE m.sample=?1") java.util.Set<MetadataEntry> getMetadataForSample(Sample sample)
Get all theMetadataEntry
attached to the givenSample
- Parameters:
sample
- the sample to get metadata for- Returns:
- a set of
MetadataEntry
-
getMetadataForSampleAndField
@Query("FROM MetadataEntry m WHERE m.sample=?1 AND m.field IN (?2)") java.util.Set<MetadataEntry> getMetadataForSampleAndField(Sample sample, java.util.Collection<MetadataTemplateField> fields)
- Parameters:
sample
- the sample to get metadata forfields
- the fields to get on the sample- Returns:
- a set of
MetadataEntry
-
getMetadataEntryBySampleAndField
@Query("FROM MetadataEntry m WHERE m.field=?1 AND m.sample=?2") MetadataEntry getMetadataEntryBySampleAndField(MetadataTemplateField field, Sample sample)
- Parameters:
field
- theMetadataTemplateField
for which to find entriessample
- theSample
for which to find entries- Returns:
- a
MetadataEntry
-
getMetadataEntryById
@Query("FROM MetadataEntry m WHERE m.id=?1") MetadataEntry getMetadataEntryById(java.lang.Long id)
Get theMetadataEntry
by id- Parameters:
id
- theMetadataEntry
identifier- Returns:
- a
MetadataEntry
-
getMetadataEntriesCountBySamplesAndField
@Query("SELECT COUNT(m.id) FROM MetadataEntry m WHERE m.field=?1 AND m.sample in (?2)") java.lang.Long getMetadataEntriesCountBySamplesAndField(MetadataTemplateField field, java.util.List<Sample> sampleList)
- Parameters:
field
- theMetadataTemplateField
for which to find entriessampleList
- the list ofSample
for which to find entries- Returns:
- a
Long
count of entries found for the field across the list of samples
-
-