Package ome.services

Class SearchBean

  • All Implemented Interfaces:
    java.io.Serializable, java.util.Iterator<ome.model.IObject>, ome.api.Search, ome.api.ServiceInterface, ome.api.StatefulServiceInterface, ome.system.SelfConfigurableService

    @Transactional(readOnly=true)
    public class SearchBean
    extends AbstractStatefulBean
    implements ome.api.Search
    Implements the Search interface.
    Since:
    3.0-Beta3
    See Also:
    Serialized Form
    • Constructor Detail

      • SearchBean

        public SearchBean​(Executor executor,
                          java.lang.Class<? extends org.apache.lucene.analysis.Analyzer> analyzer)
      • SearchBean

        public SearchBean()
        Empty constructor required by EJB and self configuration.
    • Method Detail

      • getServiceInterface

        public java.lang.Class<? extends ome.api.ServiceInterface> getServiceInterface()
        Specified by:
        getServiceInterface in interface ome.system.SelfConfigurableService
      • setExecutor

        public void setExecutor​(Executor executor)
        Injector used by Spring, currently, since SelfConfigurableService.selfConfigure() requires it.
      • setTimeoutSetter

        public void setTimeoutSetter​(TimeoutSetter timeoutSetter)
      • setAnalyzer

        public void setAnalyzer​(java.lang.Class<? extends org.apache.lucene.analysis.Analyzer> analyzer)
        Injector used by Spring.
      • setMaxClauseCount

        @Deprecated
        public void setMaxClauseCount​(java.lang.Integer maxClauseCount)
        Deprecated.
        Injector used by Spring.
      • passivate

        @Transactional(readOnly=true)
        public void passivate()
        Specified by:
        passivate in interface ome.api.StatefulServiceInterface
      • activate

        @Transactional(readOnly=true)
        public void activate()
        Specified by:
        activate in interface ome.api.StatefulServiceInterface
      • close

        @Transactional(readOnly=true)
        public void close()
        Specified by:
        close in interface ome.api.StatefulServiceInterface
      • byAnnotatedWith

        @Transactional
        public void byAnnotatedWith​(ome.model.annotations.Annotation... examples)
        Specified by:
        byAnnotatedWith in interface ome.api.Search
      • byFullText

        @Transactional
        public void byFullText​(java.lang.String query)
        Specified by:
        byFullText in interface ome.api.Search
      • byLuceneQueryBuilder

        @Transactional
        public void byLuceneQueryBuilder​(java.lang.String fields,
                                         java.lang.String from,
                                         java.lang.String to,
                                         java.lang.String dateType,
                                         java.lang.String query)
        Specified by:
        byLuceneQueryBuilder in interface ome.api.Search
      • byHqlQuery

        @Transactional
        public void byHqlQuery​(java.lang.String query,
                               ome.parameters.Parameters p)
        Specified by:
        byHqlQuery in interface ome.api.Search
      • bySomeMustNone

        @Transactional
        public void bySomeMustNone​(java.lang.String[] some,
                                   java.lang.String[] must,
                                   java.lang.String[] none)
        Specified by:
        bySomeMustNone in interface ome.api.Search
      • bySimilarTerms

        @Transactional
        public void bySimilarTerms​(java.lang.String... terms)
        Specified by:
        bySimilarTerms in interface ome.api.Search
      • byGroupForTags

        @Transactional
        public void byGroupForTags​(java.lang.String group)
        Specified by:
        byGroupForTags in interface ome.api.Search
      • byTagForGroups

        @Transactional
        public void byTagForGroups​(java.lang.String tag)
        Specified by:
        byTagForGroups in interface ome.api.Search
      • byUUID

        @Transactional
        public void byUUID​(java.lang.String[] uuids)
      • or

        @Transactional
        public void or()
        Specified by:
        or in interface ome.api.Search
      • and

        @Transactional
        public void and()
        Specified by:
        and in interface ome.api.Search
      • not

        @Transactional
        public void not()
        Specified by:
        not in interface ome.api.Search
      • hasNext

        @Transactional
        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<ome.model.IObject>
        Specified by:
        hasNext in interface ome.api.Search
      • next

        @Transactional
        public ome.model.IObject next()
                               throws ome.conditions.ApiUsageException
        Specified by:
        next in interface java.util.Iterator<ome.model.IObject>
        Specified by:
        next in interface ome.api.Search
        Throws:
        ome.conditions.ApiUsageException
      • currentMetadata

        @Transactional
        public java.util.Map<java.lang.String,​ome.model.annotations.Annotation> currentMetadata()
        Specified by:
        currentMetadata in interface ome.api.Search
      • currentMetadataList

        @Transactional
        public java.util.List<java.util.Map<java.lang.String,​ome.model.annotations.Annotation>> currentMetadataList()
        Specified by:
        currentMetadataList in interface ome.api.Search
      • results

        @Transactional
        public <T extends ome.model.IObject> java.util.List<T> results()
        Specified by:
        results in interface ome.api.Search
      • pop

        protected ome.model.IObject pop​(java.util.List<ome.model.IObject> current)
        Wrapper method which should be called on all results for the user. Removes the value from the last list, and applies all requirements of values.
      • lastresultsAsWorkingGroup

        @Transactional
        public void lastresultsAsWorkingGroup()
      • remove

        @Transactional
        public void remove()
                    throws java.lang.UnsupportedOperationException
        Specified by:
        remove in interface java.util.Iterator<ome.model.IObject>
        Specified by:
        remove in interface ome.api.Search
        Throws:
        java.lang.UnsupportedOperationException
      • activeQueries

        @Transactional
        public int activeQueries()
        Specified by:
        activeQueries in interface ome.api.Search
      • clearQueries

        @Transactional
        public void clearQueries()
        Specified by:
        clearQueries in interface ome.api.Search
      • resetDefaults

        @Transactional
        public void resetDefaults()
        Specified by:
        resetDefaults in interface ome.api.Search
      • addOrderByAsc

        @Transactional
        public void addOrderByAsc​(java.lang.String path)
        Specified by:
        addOrderByAsc in interface ome.api.Search
      • addOrderByDesc

        @Transactional
        public void addOrderByDesc​(java.lang.String path)
        Specified by:
        addOrderByDesc in interface ome.api.Search
      • unordered

        @Transactional
        public void unordered()
        Specified by:
        unordered in interface ome.api.Search
      • fetchAlso

        @Transactional
        public <T extends ome.model.IObject> void fetchAlso​(java.util.Map<T,​java.lang.String> fetches)
      • fetchAnnotations

        @Transactional
        public void fetchAnnotations​(java.lang.Class... classes)
        Specified by:
        fetchAnnotations in interface ome.api.Search
      • getBatchSize

        @Transactional
        public int getBatchSize()
        Specified by:
        getBatchSize in interface ome.api.Search
      • isCaseSensitive

        @Transactional
        public boolean isCaseSensitive()
        Specified by:
        isCaseSensitive in interface ome.api.Search
      • isMergedBatches

        @Transactional
        public boolean isMergedBatches()
        Specified by:
        isMergedBatches in interface ome.api.Search
      • onlyAnnotatedBetween

        @Transactional
        public void onlyAnnotatedBetween​(java.sql.Timestamp start,
                                         java.sql.Timestamp stop)
        Specified by:
        onlyAnnotatedBetween in interface ome.api.Search
      • onlyAnnotatedBy

        @Transactional
        public void onlyAnnotatedBy​(ome.model.internal.Details d)
        Specified by:
        onlyAnnotatedBy in interface ome.api.Search
      • notAnnotatedBy

        @Transactional
        public void notAnnotatedBy​(ome.model.internal.Details d)
        Specified by:
        notAnnotatedBy in interface ome.api.Search
      • onlyAnnotatedWith

        @Transactional
        public void onlyAnnotatedWith​(java.lang.Class... classes)
        Specified by:
        onlyAnnotatedWith in interface ome.api.Search
      • onlyCreatedBetween

        @Transactional
        public void onlyCreatedBetween​(java.sql.Timestamp start,
                                       java.sql.Timestamp stop)
        Specified by:
        onlyCreatedBetween in interface ome.api.Search
      • onlyOwnedBy

        @Transactional
        public void onlyOwnedBy​(ome.model.internal.Details d)
        Specified by:
        onlyOwnedBy in interface ome.api.Search
      • onlyIds

        @Transactional
        public void onlyIds​(java.lang.Long... ids)
        Specified by:
        onlyIds in interface ome.api.Search
      • notOwnedBy

        @Transactional
        public void notOwnedBy​(ome.model.internal.Details d)
        Specified by:
        notOwnedBy in interface ome.api.Search
      • allTypes

        @Transactional
        public void allTypes()
        Specified by:
        allTypes in interface ome.api.Search
      • onlyType

        @Transactional
        public <T extends ome.model.IObject> void onlyType​(java.lang.Class<T> klass)
        Specified by:
        onlyType in interface ome.api.Search
      • onlyTypes

        @Transactional
        public <T extends ome.model.IObject> void onlyTypes​(java.lang.Class<T>... classes)
        Specified by:
        onlyTypes in interface ome.api.Search
      • setAllowLeadingWildcard

        @Transactional
        public void setAllowLeadingWildcard​(boolean allowLeadingWildcard)
        Specified by:
        setAllowLeadingWildcard in interface ome.api.Search
      • setBatchSize

        @Transactional
        public void setBatchSize​(int size)
        Specified by:
        setBatchSize in interface ome.api.Search
      • setIdOnly

        @Transactional
        public void setIdOnly()
      • setMergedBatches

        @Transactional
        public void setMergedBatches​(boolean merge)
        Specified by:
        setMergedBatches in interface ome.api.Search
      • fetchAlso

        @Transactional
        public void fetchAlso​(java.lang.String... fetches)
        Specified by:
        fetchAlso in interface ome.api.Search
      • isAllowLeadingWildcard

        @Transactional
        public boolean isAllowLeadingWildcard()
        Specified by:
        isAllowLeadingWildcard in interface ome.api.Search
      • isReturnUnloaded

        @Transactional
        public boolean isReturnUnloaded()
        Specified by:
        isReturnUnloaded in interface ome.api.Search
      • isUseProjections

        @Transactional
        public boolean isUseProjections()
        Specified by:
        isUseProjections in interface ome.api.Search
      • onlyModifiedBetween

        @Transactional
        public void onlyModifiedBetween​(java.sql.Timestamp start,
                                        java.sql.Timestamp stop)
        Specified by:
        onlyModifiedBetween in interface ome.api.Search
      • setCaseSentivice

        @Transactional
        public void setCaseSentivice​(boolean caseSensitive)
        Specified by:
        setCaseSentivice in interface ome.api.Search
      • setCaseSensitive

        @Transactional
        public void setCaseSensitive​(boolean caseSensitive)
        Specified by:
        setCaseSensitive in interface ome.api.Search
      • setReturnUnloaded

        @Transactional
        public void setReturnUnloaded​(boolean returnUnloaded)
        Specified by:
        setReturnUnloaded in interface ome.api.Search
      • setUseProjections

        @Transactional
        public void setUseProjections​(boolean useProjections)
        Specified by:
        setUseProjections in interface ome.api.Search
      • addAction

        public void addAction​(SearchAction action)
      • addResult

        public void addResult​(java.util.List<ome.model.IObject> result)
      • addParameters

        public void addParameters​(ome.parameters.Parameters params)