Package ubic.gemma.persistence.service
Class AbstractFilteringVoEnabledService<O extends Identifiable,VO extends IdentifiableValueObject<O>>
- java.lang.Object
-
- ubic.gemma.persistence.service.AbstractService<O>
-
- ubic.gemma.persistence.service.AbstractFilteringVoEnabledService<O,VO>
-
- All Implemented Interfaces:
BaseImmutableService<O>
,BaseReadOnlyService<O>
,BaseService<O>
,BaseVoEnabledService<O,VO>
,FilteringService<O>
,FilteringVoEnabledService<O,VO>
- Direct Known Subclasses:
ArrayDesignServiceImpl
,BioAssayServiceImpl
,CharacteristicServiceImpl
,CompositeSequenceServiceImpl
,DatabaseEntryServiceImpl
,ExpressionAnalysisResultSetServiceImpl
,ExpressionExperimentServiceImpl
,FactorValueServiceImpl
,GeneServiceImpl
,QuantitationTypeServiceImpl
,TaxonServiceImpl
public abstract class AbstractFilteringVoEnabledService<O extends Identifiable,VO extends IdentifiableValueObject<O>> extends AbstractService<O> implements FilteringVoEnabledService<O,VO>, BaseService<O>
Base implementation forFilteringVoEnabledService
.
-
-
Field Summary
-
Fields inherited from class ubic.gemma.persistence.service.AbstractService
log
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractFilteringVoEnabledService(FilteringVoEnabledDao<O,VO> voDao)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
count(Filters filters)
<T> Filter
getFilter(String property, Class<T> propertyType, Filter.Operator operator, Collection<T> values)
<T> Filter
getFilter(String property, Class<T> propertyType, Filter.Operator operator, T value)
Filter
getFilter(String property, Filter.Operator operator, String value)
Filter
getFilter(String property, Filter.Operator operator, String value, SubqueryMode subqueryMode)
Filter
getFilter(String property, Filter.Operator operator, Collection<String> values)
Filter
getFilter(String property, Filter.Operator operator, Collection<String> values, SubqueryMode subqueryMode)
Set<String>
getFilterableProperties()
List<Object>
getFilterablePropertyAllowedValues(String property)
Collection<org.springframework.security.access.ConfigAttribute>
getFilterablePropertyConfigAttributes(String property)
Obtain the Spring Security config attributes for a given property.String
getFilterablePropertyDescription(String property)
boolean
getFilterablePropertyIsUsingSubquery(String property)
List<org.springframework.context.MessageSourceResolvable>
getFilterablePropertyResolvableAllowedValuesLabels(String p)
Obtain a list of resolvableMessageSourceResolvable
s to be used for user display purposes.Class<?>
getFilterablePropertyType(String property)
String
getIdentifierPropertyName()
Sort
getSort(String property, Sort.Direction direction, Sort.NullMode nullMode)
List<O>
load(Filters filters, Sort sort)
Slice<O>
load(Filters filters, Sort sort, int offset, int limit)
List<VO>
loadAllValueObjects()
Loads value objects representing all the entities of specific type.List<Long>
loadIds(Filters filters, Sort sort)
VO
loadValueObject(O entity)
VO
loadValueObjectById(Long entityId)
List<VO>
loadValueObjects(Collection<O> entities)
Loads value objects for all given entities.List<VO>
loadValueObjects(Filters filters, Sort sort)
Slice<VO>
loadValueObjects(Filters filters, Sort sort, int offset, int limit)
List<VO>
loadValueObjectsByIds(Collection<Long> entityIds)
Load value objects by a given collection of IDs.-
Methods inherited from class ubic.gemma.persistence.service.AbstractService
countAll, create, create, ensureInSession, ensureInSession, find, findOrCreate, findOrFail, getElementClass, load, load, loadAll, loadOrFail, loadOrFail, loadOrFail, loadOrFail, remove, remove, remove, save, save, update, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ubic.gemma.persistence.service.BaseImmutableService
create, create, findOrCreate, remove, remove, remove
-
Methods inherited from interface ubic.gemma.persistence.service.BaseReadOnlyService
countAll, find, findOrFail, getElementClass, load, load, loadAll, loadOrFail, loadOrFail, loadOrFail, loadOrFail
-
Methods inherited from interface ubic.gemma.persistence.service.BaseService
save, save, update, update
-
-
-
-
Constructor Detail
-
AbstractFilteringVoEnabledService
protected AbstractFilteringVoEnabledService(FilteringVoEnabledDao<O,VO> voDao)
-
-
Method Detail
-
getIdentifierPropertyName
public String getIdentifierPropertyName()
- Specified by:
getIdentifierPropertyName
in interfaceFilteringService<O extends Identifiable>
- See Also:
BaseDao.getIdentifierPropertyName()
-
loadIds
@Transactional(readOnly=true) public List<Long> loadIds(@Nullable Filters filters, @Nullable Sort sort)
- Specified by:
loadIds
in interfaceFilteringService<O extends Identifiable>
- See Also:
FilteringDao.loadIds(Filters, Sort)
-
load
@Transactional(readOnly=true) public List<O> load(@Nullable Filters filters, @Nullable Sort sort)
- Specified by:
load
in interfaceFilteringService<O extends Identifiable>
- See Also:
FilteringDao.load(Filters, Sort)
-
load
@Transactional(readOnly=true) public Slice<O> load(@Nullable Filters filters, @Nullable Sort sort, int offset, int limit)
- Specified by:
load
in interfaceFilteringService<O extends Identifiable>
- See Also:
FilteringDao.load(Filters, Sort, int, int)
-
loadValueObject
@Transactional(readOnly=true) public VO loadValueObject(O entity)
- Specified by:
loadValueObject
in interfaceBaseVoEnabledService<O extends Identifiable,VO extends IdentifiableValueObject<O>>
- See Also:
BaseVoEnabledDao.loadValueObject(Identifiable)
-
loadValueObjectById
@Transactional(readOnly=true) public VO loadValueObjectById(Long entityId)
- Specified by:
loadValueObjectById
in interfaceBaseVoEnabledService<O extends Identifiable,VO extends IdentifiableValueObject<O>>
- See Also:
BaseVoEnabledDao.loadValueObjectById(Long)
-
loadValueObjects
@Transactional(readOnly=true) public List<VO> loadValueObjects(Collection<O> entities)
Description copied from interface:BaseVoEnabledService
Loads value objects for all given entities.- Specified by:
loadValueObjects
in interfaceBaseVoEnabledService<O extends Identifiable,VO extends IdentifiableValueObject<O>>
- Parameters:
entities
- the entities to be converted to value objects- Returns:
- a collection of value objects representing he given entities.
-
loadValueObjectsByIds
@Transactional(readOnly=true) public List<VO> loadValueObjectsByIds(Collection<Long> entityIds)
Description copied from interface:BaseVoEnabledService
Load value objects by a given collection of IDs.- Specified by:
loadValueObjectsByIds
in interfaceBaseVoEnabledService<O extends Identifiable,VO extends IdentifiableValueObject<O>>
-
loadAllValueObjects
@Transactional(readOnly=true) public List<VO> loadAllValueObjects()
Description copied from interface:BaseVoEnabledService
Loads value objects representing all the entities of specific type.- Specified by:
loadAllValueObjects
in interfaceBaseVoEnabledService<O extends Identifiable,VO extends IdentifiableValueObject<O>>
- Returns:
- a collection of value objects
-
loadValueObjects
@Transactional(readOnly=true) public Slice<VO> loadValueObjects(@Nullable Filters filters, @Nullable Sort sort, int offset, int limit)
- Specified by:
loadValueObjects
in interfaceFilteringVoEnabledService<O extends Identifiable,VO extends IdentifiableValueObject<O>>
- See Also:
FilteringVoEnabledDao.loadValueObjects(Filters, Sort, int, int)
-
loadValueObjects
@Transactional(readOnly=true) public List<VO> loadValueObjects(@Nullable Filters filters, @Nullable Sort sort)
- Specified by:
loadValueObjects
in interfaceFilteringVoEnabledService<O extends Identifiable,VO extends IdentifiableValueObject<O>>
- See Also:
FilteringVoEnabledDao.loadValueObjects(Filters, Sort)
-
count
@Transactional(readOnly=true) public long count(@Nullable Filters filters)
- Specified by:
count
in interfaceFilteringService<O extends Identifiable>
- See Also:
FilteringDao.count(Filters)
-
getFilterableProperties
public Set<String> getFilterableProperties()
- Specified by:
getFilterableProperties
in interfaceFilteringService<O extends Identifiable>
- See Also:
FilteringDao.getFilterableProperties()
-
getFilterablePropertyType
public Class<?> getFilterablePropertyType(String property)
- Specified by:
getFilterablePropertyType
in interfaceFilteringService<O extends Identifiable>
- See Also:
FilteringDao.getFilterablePropertyType(String)
-
getFilterablePropertyDescription
@Nullable public String getFilterablePropertyDescription(String property)
- Specified by:
getFilterablePropertyDescription
in interfaceFilteringService<O extends Identifiable>
- See Also:
FilteringDao.getFilterablePropertyDescription(String)
-
getFilterablePropertyAllowedValues
@Nullable public List<Object> getFilterablePropertyAllowedValues(String property)
- Specified by:
getFilterablePropertyAllowedValues
in interfaceFilteringService<O extends Identifiable>
- See Also:
FilteringDao.getFilterablePropertyAllowedValues(String)
-
getFilterablePropertyResolvableAllowedValuesLabels
@Nullable public List<org.springframework.context.MessageSourceResolvable> getFilterablePropertyResolvableAllowedValuesLabels(String p)
Description copied from interface:FilteringService
Obtain a list of resolvableMessageSourceResolvable
s to be used for user display purposes.Nullity and the number of elements is guaranteed to match
FilteringService.getFilterablePropertyAllowedValues(String)
(String)}, so the two methods can be used jointly.- Specified by:
getFilterablePropertyResolvableAllowedValuesLabels
in interfaceFilteringService<O extends Identifiable>
- See Also:
FilteringService.getFilterablePropertyResolvableAllowedValuesLabels(String)
-
getFilterablePropertyIsUsingSubquery
public boolean getFilterablePropertyIsUsingSubquery(String property)
- Specified by:
getFilterablePropertyIsUsingSubquery
in interfaceFilteringService<O extends Identifiable>
- See Also:
FilteringDao.getFilterablePropertyIsUsingSubquery(String)
-
getFilterablePropertyConfigAttributes
@Nullable public Collection<org.springframework.security.access.ConfigAttribute> getFilterablePropertyConfigAttributes(String property)
Description copied from interface:FilteringService
Obtain the Spring Security config attributes for a given property.- Specified by:
getFilterablePropertyConfigAttributes
in interfaceFilteringService<O extends Identifiable>
- Returns:
- the config attributes, or null if no security check should be performed
-
getFilter
public Filter getFilter(String property, Filter.Operator operator, String value) throws IllegalArgumentException
- Specified by:
getFilter
in interfaceFilteringService<O extends Identifiable>
- Throws:
IllegalArgumentException
- See Also:
FilteringDao.getFilterableProperties()
-
getFilter
public Filter getFilter(String property, Filter.Operator operator, String value, SubqueryMode subqueryMode) throws IllegalArgumentException
- Specified by:
getFilter
in interfaceFilteringService<O extends Identifiable>
- Throws:
IllegalArgumentException
-
getFilter
public Filter getFilter(String property, Filter.Operator operator, Collection<String> values) throws IllegalArgumentException
- Specified by:
getFilter
in interfaceFilteringService<O extends Identifiable>
- Throws:
IllegalArgumentException
- See Also:
FilteringDao.getFilter(String, Filter.Operator, Collection)
-
getFilter
public Filter getFilter(String property, Filter.Operator operator, Collection<String> values, SubqueryMode subqueryMode) throws IllegalArgumentException
- Specified by:
getFilter
in interfaceFilteringService<O extends Identifiable>
- Throws:
IllegalArgumentException
-
getFilter
public <T> Filter getFilter(String property, Class<T> propertyType, Filter.Operator operator, T value)
- Specified by:
getFilter
in interfaceFilteringService<O extends Identifiable>
- See Also:
FilteringDao.getFilter(String, Class, Filter.Operator, Object)
-
getFilter
public <T> Filter getFilter(String property, Class<T> propertyType, Filter.Operator operator, Collection<T> values)
- Specified by:
getFilter
in interfaceFilteringService<O extends Identifiable>
- See Also:
FilteringDao.getFilter(String, Class, Filter.Operator, Collection)
-
getSort
public Sort getSort(String property, @Nullable Sort.Direction direction, Sort.NullMode nullMode) throws IllegalArgumentException
- Specified by:
getSort
in interfaceFilteringService<O extends Identifiable>
- Throws:
IllegalArgumentException
- See Also:
FilteringDao.getSort(String, Sort.Direction, Sort.NullMode)
-
-