ome.services
Class SearchBean

java.lang.Object
  extended by ome.services.AbstractStatefulBean
      extended by ome.services.SearchBean
All Implemented Interfaces:
Serializable, Iterator<ome.model.IObject>, Search, ServiceInterface, StatefulServiceInterface, SelfConfigurableService

@Transactional(readOnly=true)
public class SearchBean
extends AbstractStatefulBean
implements Search

Implements the Search interface.

Since:
3.0-Beta3
Author:
Josh Moore, josh at glencoesoftware.com
See Also:
Serialized Form

Field Summary
 
Fields inherited from class ome.services.AbstractStatefulBean
iQuery, iUpdate, modified, sec
 
Fields inherited from interface ome.api.Search
ALLOW_LEADING_WILDCARD, DEFAULT_BATCH_SIZE, DEFAULT_CASE_SENSITIVTY, DEFAULT_MERGED_BATCHES, DEFAULT_RETURN_UNLOADED, DEFAULT_USE_PROJECTIONS, SCORE
 
Constructor Summary
SearchBean()
          Empty constructor required by EJB and self configuration.
SearchBean(Executor executor, Class<? extends Analyzer> analyzer)
           
 
Method Summary
 void activate()
          Completely restore this service for active use from whatever passivation it has implemented.
 int activeQueries()
          Returns the number of active queries.
 void addAction(SearchAction action)
           
 void addOrderByAsc(String path)
          A path from the target entity which will be added to the current stack of order statements applied to the query.
 void addOrderByDesc(String path)
          A path from the target entity which will be added to the current stack of order statements applied to the query.
 void addResult(List<ome.model.IObject> result)
           
 void allTypes()
          Permits all types to be returned.
 void and()
          Applies the next by* method to the previous by* method, so that a call Search.hasNext(), Search.next(), or Search.results() sees only the intersection of the two calls.
 void byAnnotatedWith(ome.model.annotations.Annotation... examples)
          Finds entities annotated with an Annotation similar to the example.
 void byFullText(String query)
          Passes the query as is to the Lucene backend.
 void byGroupForTags(String group)
          Returns transient (without ID) TagAnnotation instances which represent all the tags in the given group.
 void byHqlQuery(String query, ome.parameters.Parameters p)
          Delegates to IQuery.findAllByQuery(String, Parameters) method to take advantage of the Search.and(), Search.or(), and Search.not() methods, or queue-semantics.
 void bySimilarTerms(String... terms)
          Returns transient (without ID) TextAnnotation instances which represent terms which are similar to the give terms.
 void bySomeMustNone(String[] some, String[] must, String[] none)
          Builds a Lucene query and passes it to Search.byFullText(String).
 void byTagForGroups(String tag)
          Creates a query which will return transient (without ID) TagAnnotation instances which represent all the tag groups which the given tag belongs to.
 void byUUID(String[] uuids)
           
 void clearQueries()
          Removes all active queries (leaving settings alone), such that Search.activeQueries() will return 0.
 void close()
          signals the end of the service lifecycle.
 Map<String,ome.model.annotations.Annotation> currentMetadata()
          Provides access to the extra query information (for example Lucene score and boost values) for a single call to Search.next().
 List<Map<String,ome.model.annotations.Annotation>> currentMetadataList()
          Provides access to the extra query information (for example Lucene score and boost values) for a single call to Search.results().
<T extends ome.model.IObject>
void
fetchAlso(Map<T,String> fetches)
           
 void fetchAlso(String... fetches)
          Adds a fetch clause for loading non-annotation fields of returned entities.
 void fetchAnnotations(Class... classes)
          Queries the database for all annotations of the given types for all returned instances.
 int getBatchSize()
          Returns the current batch size.
 Class<? extends ServiceInterface> getServiceInterface()
           
 boolean hasNext()
          Returns true if another call to Search.next() is valid.
 boolean isAllowLeadingWildcard()
          Returns the current leading-wildcard setting.
 boolean isCaseSensitive()
          Returns the current case sensitivity setting.
 boolean isMergedBatches()
          Returns the current merged-batches setting.
 boolean isReturnUnloaded()
          Returns the current return-unloaded setting.
 boolean isUseProjections()
          Returns the current use-projection setting.
 void lastresultsAsWorkingGroup()
           
 ome.model.IObject next()
          Returns the next entity from the current query.
 void not()
          Applies the next by* method to the previous by* method, so that a call Search.hasNext(), Search.next(), or Search.results() sees only the intersection of the two calls.
 void notAnnotatedBy(ome.model.internal.Details d)
          Restricts entities by who has not annotated them with an Annotation matching the other filters.
 void notOwnedBy(ome.model.internal.Details d)
          Uses the Details.getOwner() and Details.getGroup() information to restrict the entities which will be returned.
 void onlyAnnotatedBetween(Timestamp start, Timestamp stop)
          Restricts entities by the time in which any annotation (which matches the other filters) was added them.
 void onlyAnnotatedBy(ome.model.internal.Details d)
          Restricts entities by who has annotated them with an Annotation matching the other filters.
 void onlyAnnotatedWith(Class... classes)
          Restricts entities to having an Annotation of all the given types.
 void onlyCreatedBetween(Timestamp start, Timestamp stop)
          Restricts the time between which an entity may have been created.
 void onlyIds(Long... ids)
          Restricts the set of ids which will be checked.
 void onlyModifiedBetween(Timestamp start, Timestamp stop)
          Restricts the time between which an entity may have last been modified.
 void onlyOwnedBy(ome.model.internal.Details d)
          Uses the Details.getOwner() and Details.getGroup() information to restrict the entities which will be returned.
<T extends ome.model.IObject>
void
onlyType(Class<T> klass)
          Restricts the search to a single type.
<T extends ome.model.IObject>
void
onlyTypes(Class<T>... classes)
          Restricts searches to a set of types.
 void or()
          Applies the next by* method to the previous by* method, so that a call Search.hasNext(), Search.next(), or Search.results() sees only the union of the two calls.
 void passivate()
          Perform whatever passivation is possible or throw an exception.
protected  ome.model.IObject pop(List<ome.model.IObject> current)
          Wrapper method which should be called on all results for the user.
 void remove()
          Unsupported operation.
 void resetDefaults()
          Resets all settings (non-query state) to the original default values, as if the instance had just be created.
<T extends ome.model.IObject>
List<T>
results()
          Returns up to batch size number of results along with the related query metadata.
 void setAllowLeadingWildcard(boolean allowLeadingWildcard)
          Permits full-text queries with a leading query if true.
 void setAnalyzer(Class<? extends Analyzer> analyzer)
          Injector used by Spring.
 void setBatchSize(int size)
          Sets the maximum number of results that will be returned by one call to Search.results().
 void setCaseSentivice(boolean caseSensitive)
          Sets the case sensitivity on all queries where case-sensitivity is supported.
 void setExecutor(Executor executor)
          Injector used by Spring, currently, since SelfConfigurableService.selfConfigure() requires it.
 void setIdOnly()
           
 void setMaxClauseCount(Integer maxClauseCount)
          Injector used by Spring.
 void setMergedBatches(boolean merge)
          Set whether or not results from two separate queries can be returned in the same call to Search.results().
 void setReturnUnloaded(boolean returnUnloaded)
          Determines if all results should be returned as unloaded objects.
 void setUseProjections(boolean useProjections)
          Determines if Lucene queries should not hit the database.
 void unordered()
          Removes the current stack of order statements.
 
Methods inherited from class ome.services.AbstractStatefulBean
getBeanHelper, getCurrentEventContext, isModified, modified, selfConfigure, setQueryService, setSecuritySystem, setUpdateService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ome.api.StatefulServiceInterface
getCurrentEventContext
 

Constructor Detail

SearchBean

public SearchBean(Executor executor,
                  Class<? extends Analyzer> analyzer)

SearchBean

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

Method Detail

getServiceInterface

public Class<? extends ServiceInterface> getServiceInterface()
Specified by:
getServiceInterface in interface SelfConfigurableService

setExecutor

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


setAnalyzer

public void setAnalyzer(Class<? extends Analyzer> analyzer)
Injector used by Spring.


setMaxClauseCount

public void setMaxClauseCount(Integer maxClauseCount)
Injector used by Spring.


passivate

@Transactional(readOnly=true)
public void passivate()
Description copied from interface: StatefulServiceInterface
Perform whatever passivation is possible or throw an exception. A good passivation method will free up as much memory as possible, most likely by storing it to disk. A call to passivate should be safe even if the service is already passivated.

Specified by:
passivate in interface StatefulServiceInterface

activate

@Transactional(readOnly=true)
public void activate()
Description copied from interface: StatefulServiceInterface
Completely restore this service for active use from whatever passivation it has implemented. A call to activate should be safe even if the service is already activated.

Specified by:
activate in interface StatefulServiceInterface

close

@Transactional(readOnly=true)
public void close()
Description copied from interface: StatefulServiceInterface
signals the end of the service lifecycle. Resources such as Sessions can be released. All further calls will throw an exception.

Specified by:
close in interface StatefulServiceInterface

byAnnotatedWith

@Transactional
public void byAnnotatedWith(ome.model.annotations.Annotation... examples)
Description copied from interface: Search
Finds entities annotated with an Annotation similar to the example. This does not use Hibernate's Query-By-Example mechanism, since that cannot handle joins. The fields which are used are:

If the main content is null it is assumed to be a wildcard searched, and only the type of the annotation is searched. Currently, ListAnnotations are not supported.

Specified by:
byAnnotatedWith in interface Search
Parameters:
examples - Not empty.

byFullText

@Transactional
public void byFullText(String query)
Description copied from interface: Search
Passes the query as is to the Lucene backend.

Specified by:
byFullText in interface Search
Parameters:
query - May not be null or of zero length.

byHqlQuery

@Transactional
public void byHqlQuery(String query,
                                     ome.parameters.Parameters p)
Description copied from interface: Search
Delegates to IQuery.findAllByQuery(String, Parameters) method to take advantage of the Search.and(), Search.or(), and Search.not() methods, or queue-semantics.

Specified by:
byHqlQuery in interface Search
Parameters:
query - Not null.
p - May be null. Defaults are then in effect.
See Also:
IQuery.findAllByQuery(String, Parameters)

bySomeMustNone

@Transactional
public void bySomeMustNone(String[] some,
                                         String[] must,
                                         String[] none)
Description copied from interface: Search
Builds a Lucene query and passes it to Search.byFullText(String).

Specified by:
bySomeMustNone in interface Search
Parameters:
some - Some (at least one) of these terms must be present in the document. May be null.
must - All of these terms must be present in the document. May be null.
none - None of these terms may be present in the document. May be null.

bySimilarTerms

@Transactional
public void bySimilarTerms(String... terms)
Description copied from interface: Search
Returns transient (without ID) TextAnnotation instances which represent terms which are similar to the give terms. For example, if the argument is "cell", one return value might have as its textValue: "cellular" while another has "cellularize". No filtering or fetching is performed.

Specified by:
bySimilarTerms in interface Search
Parameters:
terms - Cannot be empty.

byGroupForTags

@Transactional
public void byGroupForTags(String group)
Description copied from interface: Search
Returns transient (without ID) TagAnnotation instances which represent all the tags in the given group. The entities are transient and without ownership since multiple users can own the same tag. This method will override settings for types.

Specified by:
byGroupForTags in interface Search
Parameters:
group - Can be null or empty to return all tags.

byTagForGroups

@Transactional
public void byTagForGroups(String tag)
Description copied from interface: Search
Creates a query which will return transient (without ID) TagAnnotation instances which represent all the tag groups which the given tag belongs to. The entities are transient and without ownership since multiple users can own the same tag group. This method will override settings for types.

Specified by:
byTagForGroups in interface Search
Parameters:
tag - Can be null or empty to return all groups.

byUUID

@Transactional
public void byUUID(String[] uuids)

or

@Transactional
public void or()
Description copied from interface: Search
Applies the next by* method to the previous by* method, so that a call Search.hasNext(), Search.next(), or Search.results() sees only the union of the two calls. For example,
 service.onlyType(Image.class);
 service.byFullText("foo");
 service.or();
 service.onlyType(Dataset.class);
 service.byFullText("foo");
 
will return both Images and Datasets together. Calling this method overrides a previous setting of Search.and() or Search.not(). If there is no active queries (i.e. Search.activeQueries() > 0), then an ApiUsageException will be thrown.

Specified by:
or in interface Search

and

@Transactional
public void and()
Description copied from interface: Search
Applies the next by* method to the previous by* method, so that a call Search.hasNext(), Search.next(), or Search.results() sees only the intersection of the two calls. For example,
 service.onlyType(Image.class);
 service.byFullText("foo");
 service.intersection();
 service.byAnnotatedWith(TagAnnotation.class);
 
will return only the Images with TagAnnotations.

Calling this method overrides a previous setting of Search.or() or Search.not(). If there is no active queries (i.e. Search.activeQueries() > 0), then an ApiUsageException will be thrown.

Specified by:
and in interface Search

not

@Transactional
public void not()
Description copied from interface: Search
Applies the next by* method to the previous by* method, so that a call Search.hasNext(), Search.next(), or Search.results() sees only the intersection of the two calls. For example,
 service.onlyType(Image.class);
 service.byFullText("foo");
 service.complement();
 service.byAnnotatedWith(TagAnnotation.class);
 
will return all the Images not annotated with TagAnnotation.

Calling this method overrides a previous setting of Search.or() or Search.and(). If there is no active queries (i.e. Search.activeQueries() > 0), then an ApiUsageException will be thrown.

Specified by:
not in interface Search

hasNext

@Transactional
public boolean hasNext()
Description copied from interface: Search
Returns true if another call to Search.next() is valid. A call to Search.next() may throw an exception for another reason, however.

Specified by:
hasNext in interface Iterator<ome.model.IObject>
Specified by:
hasNext in interface Search

next

@Transactional
public ome.model.IObject next()
                       throws ome.conditions.ApiUsageException
Description copied from interface: Search
Returns the next entity from the current query. If the previous call returned the last entity from a given query, the first entity from the next query will be returned and Search.activeQueries() decremented. Since this method only returns the entity itself, a single call to Search.currentMetadata() may follow this call to gather the extra metadata which is returned in the map via Search.results().

Specified by:
next in interface Iterator<ome.model.IObject>
Specified by:
next in interface Search
Throws:
ome.conditions.ApiUsageException - if Search.hasNext() returns false.

currentMetadata

@Transactional
public Map<String,ome.model.annotations.Annotation> currentMetadata()
Description copied from interface: Search
Provides access to the extra query information (for example Lucene score and boost values) for a single call to Search.next(). This method may only be called once for any given call to Search.next().

Specified by:
currentMetadata in interface Search

currentMetadataList

@Transactional
public List<Map<String,ome.model.annotations.Annotation>> currentMetadataList()
Description copied from interface: Search
Provides access to the extra query information (for example Lucene score and boost values) for a single call to Search.results(). This method may only be called once for any given call to Search.results().

Specified by:
currentMetadataList in interface Search

results

@Transactional
public <T extends ome.model.IObject> List<T> results()
Description copied from interface: Search
Returns up to batch size number of results along with the related query metadata. If batches are merged then the results from multiple queries may be returned together.

Specified by:
results in interface Search

pop

protected ome.model.IObject pop(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 UnsupportedOperationException
Description copied from interface: Search
Unsupported operation.

Specified by:
remove in interface Iterator<ome.model.IObject>
Specified by:
remove in interface Search
Throws:
UnsupportedOperationException

activeQueries

@Transactional
public int activeQueries()
Description copied from interface: Search
Returns the number of active queries. This means that activeQueries gives the minimum number of remaining calls to Search.results() when batches are not merged.

Specified by:
activeQueries in interface Search
Returns:
number of active queries

clearQueries

@Transactional
public void clearQueries()
Description copied from interface: Search
Removes all active queries (leaving settings alone), such that Search.activeQueries() will return 0.

Specified by:
clearQueries in interface Search

resetDefaults

@Transactional
public void resetDefaults()
Description copied from interface: Search
Resets all settings (non-query state) to the original default values, as if the instance had just be created.

Specified by:
resetDefaults in interface Search

addOrderByAsc

@Transactional
public void addOrderByAsc(String path)
Description copied from interface: Search
A path from the target entity which will be added to the current stack of order statements applied to the query.

Specified by:
addOrderByAsc in interface Search
Parameters:
path - Non-null.
See Also:
Search.unordered()

addOrderByDesc

@Transactional
public void addOrderByDesc(String path)
Description copied from interface: Search
A path from the target entity which will be added to the current stack of order statements applied to the query.

Specified by:
addOrderByDesc in interface Search
Parameters:
path - Non-null.
See Also:
Search.unordered()

unordered

@Transactional
public void unordered()
Description copied from interface: Search
Removes the current stack of order statements.

Specified by:
unordered in interface Search
See Also:
Search.addOrderByAsc(String), Search.addOrderByDesc(String)

fetchAlso

@Transactional
public <T extends ome.model.IObject> void fetchAlso(Map<T,String> fetches)

fetchAnnotations

@Transactional
public void fetchAnnotations(Class... classes)
Description copied from interface: Search
Queries the database for all annotations of the given types for all returned instances.

Specified by:
fetchAnnotations in interface Search
Parameters:
classes - Can be empty, which removes previous fetch setting.

getBatchSize

@Transactional
public int getBatchSize()
Description copied from interface: Search
Returns the current batch size. If Search.setBatchSize(int) has not been called, the default value will be in effect.

Specified by:
getBatchSize in interface Search
Returns:
maximum number of results per call to Search.results()
See Also:
Search.DEFAULT_BATCH_SIZE

isCaseSensitive

@Transactional
public boolean isCaseSensitive()
Description copied from interface: Search
Returns the current case sensitivity setting. If #setCaseSentivice() has not been called, the default value will be in effect.

Specified by:
isCaseSensitive in interface Search

isMergedBatches

@Transactional
public boolean isMergedBatches()
Description copied from interface: Search
Returns the current merged-batches setting. If Search.setMergedBatches(boolean) has not been called, the default value will be in effect.

Specified by:
isMergedBatches in interface Search

onlyAnnotatedBetween

@Transactional
public void onlyAnnotatedBetween(Timestamp start,
                                               Timestamp stop)
Description copied from interface: Search
Restricts entities by the time in which any annotation (which matches the other filters) was added them. This matches the creation event of the Annotation.

Specified by:
onlyAnnotatedBetween in interface Search
Parameters:
start - Can be null, i.e. interval open to negative infinity.
stop - Can be null, i.e. interval open to positive infinity.

onlyAnnotatedBy

@Transactional
public void onlyAnnotatedBy(ome.model.internal.Details d)
Description copied from interface: Search
Restricts entities by who has annotated them with an Annotation matching the other filters. As Search.onlyOwnedBy(Details), the Details.getOwner() and Details.getGroup() information is combined with an AND condition.

Specified by:
onlyAnnotatedBy in interface Search
Parameters:
d - Can be null, in which case any previous restriction is removed.

notAnnotatedBy

@Transactional
public void notAnnotatedBy(ome.model.internal.Details d)
Description copied from interface: Search
Restricts entities by who has not annotated them with an Annotation matching the other filters. As Search.notOwnedBy(Details), the Details.getOwner() and Details.getGroup() information is combined with an AND condition.

Specified by:
notAnnotatedBy in interface Search
Parameters:
d - Can be null, in which case any previous restriction is removed.

onlyAnnotatedWith

@Transactional
public void onlyAnnotatedWith(Class... classes)
Description copied from interface: Search
Restricts entities to having an Annotation of all the given types. This is useful in combination with the other onlyAnnotated* methods to say, e.g., only annotated with a file by user X. By default, this value is null and imposes no restriction. Passing an empty array implies an object that is not annotated at all. Note: If the semantics were OR, then a client would have to query each class individually, and compare all the various values, checking which ids are where. However, since this method defaults to AND, multiple calls (optionally with Search.isMergedBatches() and Search.isReturnUnloaded()) and combine the results. Duplicate ids are still possible, so a set of some form should be used to collect the results.

Specified by:
onlyAnnotatedWith in interface Search
Parameters:
classes - Can be empty, in which case restriction is removed.

onlyCreatedBetween

@Transactional
public void onlyCreatedBetween(Timestamp start,
                                             Timestamp stop)
Description copied from interface: Search
Restricts the time between which an entity may have been created.

Specified by:
onlyCreatedBetween in interface Search
Parameters:
start - Can be null, i.e. interval open to negative infinity.
stop - Can be null, i.e. interval opens to positive infinity.

onlyOwnedBy

@Transactional
public void onlyOwnedBy(ome.model.internal.Details d)
Description copied from interface: Search
Uses the Details.getOwner() and Details.getGroup() information to restrict the entities which will be returned. If both are non-null, the two restrictions are joined by an AND.

Specified by:
onlyOwnedBy in interface Search
Parameters:
d - Can be null, in which case the previous restriction is removed.

onlyIds

@Transactional
public void onlyIds(Long... ids)
Description copied from interface: Search
Restricts the set of ids which will be checked. This is useful for testing one of the given restrictions on a reduced set of objects.

Specified by:
onlyIds in interface Search
Parameters:
ids - Can be null, in which case the previous restriction is removed.

notOwnedBy

@Transactional
public void notOwnedBy(ome.model.internal.Details d)
Description copied from interface: Search
Uses the Details.getOwner() and Details.getGroup() information to restrict the entities which will be returned. If both are non-null, the two restrictions are joined by an AND.

Specified by:
notOwnedBy in interface Search
Parameters:
d - Can be null, in which case the previous restriction is removed.

allTypes

@Transactional
public void allTypes()
Description copied from interface: Search
Permits all types to be returned. For some types of queries, this carries a performance penalty as every database table must be hit.

Specified by:
allTypes in interface Search

onlyType

@Transactional
public <T extends ome.model.IObject> void onlyType(Class<T> klass)
Description copied from interface: Search
Restricts the search to a single type. All return values will match this type.

Specified by:
onlyType in interface Search

onlyTypes

@Transactional
public <T extends ome.model.IObject> void onlyTypes(Class<T>... classes)
Description copied from interface: Search
Restricts searches to a set of types. The entities returned are guaranteed to be one of these types.

Specified by:
onlyTypes in interface Search

setAllowLeadingWildcard

@Transactional
public void setAllowLeadingWildcard(boolean allowLeadingWildcard)
Description copied from interface: Search
Permits full-text queries with a leading query if true.

Specified by:
setAllowLeadingWildcard in interface Search
See Also:
Search.isAllowLeadingWildcard(), Search.byFullText(String), Search.bySomeMustNone(String[], String[], String[])

setBatchSize

@Transactional
public void setBatchSize(int size)
Description copied from interface: Search
Sets the maximum number of results that will be returned by one call to Search.results(). If batches are not merged, then results may often be less than the batch size. If batches are merged, then only the last call to Search.results() can be less than batch size. Note: some query types may not support batching at the query level, and all instances must then be loaded into memory simultaneously.

Specified by:
setBatchSize in interface Search
Parameters:
size - maximum number of results per call to Search.results()

setIdOnly

@Transactional
public void setIdOnly()

setMergedBatches

@Transactional
public void setMergedBatches(boolean merge)
Description copied from interface: Search
Set whether or not results from two separate queries can be returned in the same call to Search.results().

Specified by:
setMergedBatches in interface Search

fetchAlso

@Transactional
public void fetchAlso(String... fetches)
Description copied from interface: Search
Adds a fetch clause for loading non-annotation fields of returned entities. Each fetch is a hibernate clause in dot notation.

Specified by:
fetchAlso in interface Search
Parameters:
fetches - Can be empty, which removes previous fetch setting.

isAllowLeadingWildcard

@Transactional
public boolean isAllowLeadingWildcard()
Description copied from interface: Search
Returns the current leading-wildcard setting. If false, Search.byFullText(String) and Search.bySomeMustNone(String[], String[], String[]) will throw an ApiUsageException, since leading-wildcard searches are quite slow. Use #setAllowLeadingWildcard() in order to permit this usage.

Specified by:
isAllowLeadingWildcard in interface Search

isReturnUnloaded

@Transactional
public boolean isReturnUnloaded()
Description copied from interface: Search
Returns the current return-unloaded setting. If true, all returned entities will be unloaded. If Search.setReturnUnloaded(boolean) has not been called, the default value will be in effect.

Specified by:
isReturnUnloaded in interface Search

isUseProjections

@Transactional
public boolean isUseProjections()
Description copied from interface: Search
Returns the current use-projection setting. If true, the client must be careful with all results that are returned. See for more. If Search.setUseProjections(boolean) has not been called, the Search.DEFAULT_USE_PROJECTIONS will be in effect.

Specified by:
isUseProjections in interface Search

onlyModifiedBetween

@Transactional
public void onlyModifiedBetween(Timestamp start,
                                              Timestamp stop)
Description copied from interface: Search
Restricts the time between which an entity may have last been modified.

Specified by:
onlyModifiedBetween in interface Search
Parameters:
start - Can be null, i.e. interval open to negative infinity.
stop - Can be null, i.e. interval open to positive infinity.

setCaseSentivice

@Transactional
public void setCaseSentivice(boolean caseSensitive)
Description copied from interface: Search
Sets the case sensitivity on all queries where case-sensitivity is supported.

Specified by:
setCaseSentivice in interface Search

setReturnUnloaded

@Transactional
public void setReturnUnloaded(boolean returnUnloaded)
Description copied from interface: Search
Determines if all results should be returned as unloaded objects. This is particularly useful for creating lists for further querying via IQuery. This value overrides the Search.setUseProjections(boolean) setting.

Specified by:
setReturnUnloaded in interface Search

setUseProjections

@Transactional
public void setUseProjections(boolean useProjections)
Description copied from interface: Search
Determines if Lucene queries should not hit the database. Instead all values which are stored in the index will be loaded into the object, which includes the id. However, the entity will not be marked unloaded and therefore it is especially important to not allow a projection-instance to be saved back to the server. This can result in DATA LOSS.

Specified by:
setUseProjections in interface Search

addAction

public void addAction(SearchAction action)

addResult

public void addResult(List<ome.model.IObject> result)


OmeroJava Api

Version: Beta4.2.1-r8614-Beta4.2-b41

Copyright © 2009 The University of Dundee. All Rights Reserved.