public interface SearchCriteria extends TransferObject
search query
. Such object
specifies the criteria selecting which hits
will match when performing a search. getHitOffset()
,
getMaximumHitCount()
, and getSearchTimeout()
. For your individual search, you can extend
AbstractSearchCriteria
to create a java bean with all the fields for your search.
For searches in a database using JPA there is additional support provided by mmm-persistence
.SearchResult
Modifier and Type | Method and Description |
---|---|
int |
getHitOffset()
This method gets the offset for the first hit.
|
Integer |
getMaximumHitCount()
This method gets the maximum number of hits that will be received as result for this query.
|
Long |
getSearchTimeout()
This method gets the maximum delay in milliseconds the search may last until it is canceled.
|
boolean |
isReadOnly()
This method determines if the search should be performed in read-only mode.
|
Integer getMaximumHitCount()
Query.setMaxResults(int)
in JPA.null
for NO limit.int getHitOffset()
0
by default. By providing a multiple of
getMaximumHitCount()
you can simply implement paging. Query.setFirstResult(int)
in JPA.Long getSearchTimeout()
"javax.persistence.query.timeout"
in JPA.null
for NO timeout.boolean isReadOnly()
result hits
can NOT be modified or their changes will NOT be persisted. If a
search-engine does not support this feature (e.g. for full-text search this makes no sense), it will be ignored.true
if read-only, false
otherwise (default).Copyright © 2001–2016 mmm-Team. All rights reserved.