Package ome.services
Class SearchBean
- java.lang.Object
-
- ome.services.AbstractStatefulBean
-
- ome.services.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 theSearch
interface.- Since:
- 3.0-Beta3
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class ome.services.AbstractStatefulBean
iQuery, iUpdate, modified, sec
-
-
Constructor Summary
Constructors Constructor Description SearchBean()
Empty constructor required by EJB andself configuration
.SearchBean(Executor executor, java.lang.Class<? extends org.apache.lucene.analysis.Analyzer> analyzer)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
activate()
int
activeQueries()
void
addAction(SearchAction action)
void
addOrderByAsc(java.lang.String path)
void
addOrderByDesc(java.lang.String path)
void
addParameters(ome.parameters.Parameters params)
void
addResult(java.util.List<ome.model.IObject> result)
void
allTypes()
void
and()
void
byAnnotatedWith(ome.model.annotations.Annotation... examples)
void
byFullText(java.lang.String query)
void
byGroupForTags(java.lang.String group)
void
byHqlQuery(java.lang.String query, ome.parameters.Parameters p)
void
byLuceneQueryBuilder(java.lang.String fields, java.lang.String from, java.lang.String to, java.lang.String dateType, java.lang.String query)
void
bySimilarTerms(java.lang.String... terms)
void
bySomeMustNone(java.lang.String[] some, java.lang.String[] must, java.lang.String[] none)
void
byTagForGroups(java.lang.String tag)
void
byUUID(java.lang.String[] uuids)
void
clearQueries()
void
close()
java.util.Map<java.lang.String,ome.model.annotations.Annotation>
currentMetadata()
java.util.List<java.util.Map<java.lang.String,ome.model.annotations.Annotation>>
currentMetadataList()
void
fetchAlso(java.lang.String... fetches)
<T extends ome.model.IObject>
voidfetchAlso(java.util.Map<T,java.lang.String> fetches)
void
fetchAnnotations(java.lang.Class... classes)
int
getBatchSize()
java.lang.Class<? extends ome.api.ServiceInterface>
getServiceInterface()
boolean
hasNext()
boolean
isAllowLeadingWildcard()
boolean
isCaseSensitive()
boolean
isMergedBatches()
boolean
isReturnUnloaded()
boolean
isUseProjections()
void
lastresultsAsWorkingGroup()
ome.model.IObject
next()
void
not()
void
notAnnotatedBy(ome.model.internal.Details d)
void
notOwnedBy(ome.model.internal.Details d)
void
onlyAnnotatedBetween(java.sql.Timestamp start, java.sql.Timestamp stop)
void
onlyAnnotatedBy(ome.model.internal.Details d)
void
onlyAnnotatedWith(java.lang.Class... classes)
void
onlyCreatedBetween(java.sql.Timestamp start, java.sql.Timestamp stop)
void
onlyIds(java.lang.Long... ids)
void
onlyModifiedBetween(java.sql.Timestamp start, java.sql.Timestamp stop)
void
onlyOwnedBy(ome.model.internal.Details d)
<T extends ome.model.IObject>
voidonlyType(java.lang.Class<T> klass)
<T extends ome.model.IObject>
voidonlyTypes(java.lang.Class<T>... classes)
void
or()
void
passivate()
protected ome.model.IObject
pop(java.util.List<ome.model.IObject> current)
Wrapper method which should be called on all results for the user.void
remove()
void
resetDefaults()
<T extends ome.model.IObject>
java.util.List<T>results()
void
setAllowLeadingWildcard(boolean allowLeadingWildcard)
void
setAnalyzer(java.lang.Class<? extends org.apache.lucene.analysis.Analyzer> analyzer)
Injector used by Spring.void
setBatchSize(int size)
void
setCaseSensitive(boolean caseSensitive)
void
setCaseSentivice(boolean caseSensitive)
void
setExecutor(Executor executor)
Injector used by Spring, currently, sinceSelfConfigurableService.selfConfigure()
requires it.void
setIdOnly()
void
setMaxClauseCount(java.lang.Integer maxClauseCount)
Deprecated.void
setMergedBatches(boolean merge)
void
setReturnUnloaded(boolean returnUnloaded)
void
setTimeoutSetter(TimeoutSetter timeoutSetter)
void
setUseProjections(boolean useProjections)
void
unordered()
-
Methods inherited from class ome.services.AbstractStatefulBean
getBeanHelper, getCurrentEventContext, isModified, modified, selfConfigure, setQueryService, setSecuritySystem, setUpdateService
-
-
-
-
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 andself configuration
.
-
-
Method Detail
-
getServiceInterface
public java.lang.Class<? extends ome.api.ServiceInterface> getServiceInterface()
- Specified by:
getServiceInterface
in interfaceome.system.SelfConfigurableService
-
setExecutor
public void setExecutor(Executor executor)
Injector used by Spring, currently, sinceSelfConfigurableService.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 interfaceome.api.StatefulServiceInterface
-
activate
@Transactional(readOnly=true) public void activate()
- Specified by:
activate
in interfaceome.api.StatefulServiceInterface
-
close
@Transactional(readOnly=true) public void close()
- Specified by:
close
in interfaceome.api.StatefulServiceInterface
-
byAnnotatedWith
@Transactional public void byAnnotatedWith(ome.model.annotations.Annotation... examples)
- Specified by:
byAnnotatedWith
in interfaceome.api.Search
-
byFullText
@Transactional public void byFullText(java.lang.String query)
- Specified by:
byFullText
in interfaceome.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 interfaceome.api.Search
-
byHqlQuery
@Transactional public void byHqlQuery(java.lang.String query, ome.parameters.Parameters p)
- Specified by:
byHqlQuery
in interfaceome.api.Search
-
bySomeMustNone
@Transactional public void bySomeMustNone(java.lang.String[] some, java.lang.String[] must, java.lang.String[] none)
- Specified by:
bySomeMustNone
in interfaceome.api.Search
-
bySimilarTerms
@Transactional public void bySimilarTerms(java.lang.String... terms)
- Specified by:
bySimilarTerms
in interfaceome.api.Search
-
byGroupForTags
@Transactional public void byGroupForTags(java.lang.String group)
- Specified by:
byGroupForTags
in interfaceome.api.Search
-
byTagForGroups
@Transactional public void byTagForGroups(java.lang.String tag)
- Specified by:
byTagForGroups
in interfaceome.api.Search
-
byUUID
@Transactional public void byUUID(java.lang.String[] uuids)
-
or
@Transactional public void or()
- Specified by:
or
in interfaceome.api.Search
-
and
@Transactional public void and()
- Specified by:
and
in interfaceome.api.Search
-
not
@Transactional public void not()
- Specified by:
not
in interfaceome.api.Search
-
hasNext
@Transactional public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<ome.model.IObject>
- Specified by:
hasNext
in interfaceome.api.Search
-
next
@Transactional public ome.model.IObject next() throws ome.conditions.ApiUsageException
- Specified by:
next
in interfacejava.util.Iterator<ome.model.IObject>
- Specified by:
next
in interfaceome.api.Search
- Throws:
ome.conditions.ApiUsageException
-
currentMetadata
@Transactional public java.util.Map<java.lang.String,ome.model.annotations.Annotation> currentMetadata()
- Specified by:
currentMetadata
in interfaceome.api.Search
-
currentMetadataList
@Transactional public java.util.List<java.util.Map<java.lang.String,ome.model.annotations.Annotation>> currentMetadataList()
- Specified by:
currentMetadataList
in interfaceome.api.Search
-
results
@Transactional public <T extends ome.model.IObject> java.util.List<T> results()
- Specified by:
results
in interfaceome.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 ofvalues
.
-
lastresultsAsWorkingGroup
@Transactional public void lastresultsAsWorkingGroup()
-
remove
@Transactional public void remove() throws java.lang.UnsupportedOperationException
- Specified by:
remove
in interfacejava.util.Iterator<ome.model.IObject>
- Specified by:
remove
in interfaceome.api.Search
- Throws:
java.lang.UnsupportedOperationException
-
activeQueries
@Transactional public int activeQueries()
- Specified by:
activeQueries
in interfaceome.api.Search
-
clearQueries
@Transactional public void clearQueries()
- Specified by:
clearQueries
in interfaceome.api.Search
-
resetDefaults
@Transactional public void resetDefaults()
- Specified by:
resetDefaults
in interfaceome.api.Search
-
addOrderByAsc
@Transactional public void addOrderByAsc(java.lang.String path)
- Specified by:
addOrderByAsc
in interfaceome.api.Search
-
addOrderByDesc
@Transactional public void addOrderByDesc(java.lang.String path)
- Specified by:
addOrderByDesc
in interfaceome.api.Search
-
unordered
@Transactional public void unordered()
- Specified by:
unordered
in interfaceome.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 interfaceome.api.Search
-
getBatchSize
@Transactional public int getBatchSize()
- Specified by:
getBatchSize
in interfaceome.api.Search
-
isCaseSensitive
@Transactional public boolean isCaseSensitive()
- Specified by:
isCaseSensitive
in interfaceome.api.Search
-
isMergedBatches
@Transactional public boolean isMergedBatches()
- Specified by:
isMergedBatches
in interfaceome.api.Search
-
onlyAnnotatedBetween
@Transactional public void onlyAnnotatedBetween(java.sql.Timestamp start, java.sql.Timestamp stop)
- Specified by:
onlyAnnotatedBetween
in interfaceome.api.Search
-
onlyAnnotatedBy
@Transactional public void onlyAnnotatedBy(ome.model.internal.Details d)
- Specified by:
onlyAnnotatedBy
in interfaceome.api.Search
-
notAnnotatedBy
@Transactional public void notAnnotatedBy(ome.model.internal.Details d)
- Specified by:
notAnnotatedBy
in interfaceome.api.Search
-
onlyAnnotatedWith
@Transactional public void onlyAnnotatedWith(java.lang.Class... classes)
- Specified by:
onlyAnnotatedWith
in interfaceome.api.Search
-
onlyCreatedBetween
@Transactional public void onlyCreatedBetween(java.sql.Timestamp start, java.sql.Timestamp stop)
- Specified by:
onlyCreatedBetween
in interfaceome.api.Search
-
onlyOwnedBy
@Transactional public void onlyOwnedBy(ome.model.internal.Details d)
- Specified by:
onlyOwnedBy
in interfaceome.api.Search
-
onlyIds
@Transactional public void onlyIds(java.lang.Long... ids)
- Specified by:
onlyIds
in interfaceome.api.Search
-
notOwnedBy
@Transactional public void notOwnedBy(ome.model.internal.Details d)
- Specified by:
notOwnedBy
in interfaceome.api.Search
-
allTypes
@Transactional public void allTypes()
- Specified by:
allTypes
in interfaceome.api.Search
-
onlyType
@Transactional public <T extends ome.model.IObject> void onlyType(java.lang.Class<T> klass)
- Specified by:
onlyType
in interfaceome.api.Search
-
onlyTypes
@Transactional public <T extends ome.model.IObject> void onlyTypes(java.lang.Class<T>... classes)
- Specified by:
onlyTypes
in interfaceome.api.Search
-
setAllowLeadingWildcard
@Transactional public void setAllowLeadingWildcard(boolean allowLeadingWildcard)
- Specified by:
setAllowLeadingWildcard
in interfaceome.api.Search
-
setBatchSize
@Transactional public void setBatchSize(int size)
- Specified by:
setBatchSize
in interfaceome.api.Search
-
setIdOnly
@Transactional public void setIdOnly()
-
setMergedBatches
@Transactional public void setMergedBatches(boolean merge)
- Specified by:
setMergedBatches
in interfaceome.api.Search
-
fetchAlso
@Transactional public void fetchAlso(java.lang.String... fetches)
- Specified by:
fetchAlso
in interfaceome.api.Search
-
isAllowLeadingWildcard
@Transactional public boolean isAllowLeadingWildcard()
- Specified by:
isAllowLeadingWildcard
in interfaceome.api.Search
-
isReturnUnloaded
@Transactional public boolean isReturnUnloaded()
- Specified by:
isReturnUnloaded
in interfaceome.api.Search
-
isUseProjections
@Transactional public boolean isUseProjections()
- Specified by:
isUseProjections
in interfaceome.api.Search
-
onlyModifiedBetween
@Transactional public void onlyModifiedBetween(java.sql.Timestamp start, java.sql.Timestamp stop)
- Specified by:
onlyModifiedBetween
in interfaceome.api.Search
-
setCaseSentivice
@Transactional public void setCaseSentivice(boolean caseSensitive)
- Specified by:
setCaseSentivice
in interfaceome.api.Search
-
setCaseSensitive
@Transactional public void setCaseSensitive(boolean caseSensitive)
- Specified by:
setCaseSensitive
in interfaceome.api.Search
-
setReturnUnloaded
@Transactional public void setReturnUnloaded(boolean returnUnloaded)
- Specified by:
setReturnUnloaded
in interfaceome.api.Search
-
setUseProjections
@Transactional public void setUseProjections(boolean useProjections)
- Specified by:
setUseProjections
in interfaceome.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)
-
-