public abstract class AbstractSearchCriteria extends AbstractTransferObject implements SearchCriteria
SearchCriteria
.Modifier and Type | Field and Description |
---|---|
private int |
hitOffset |
private Integer |
maximumHitCount |
private boolean |
readOnly |
private Long |
searchTimeout |
private static long |
serialVersionUID |
Constructor and Description |
---|
AbstractSearchCriteria()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
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.
|
int |
hashCode() |
boolean |
isReadOnly()
This method determines if the search should be performed in read-only mode.
|
void |
limitMaximumHitCount(int limit)
Limits the
maximum hit count by the given limit . |
void |
setHitOffset(int hitOffset) |
void |
setMaximumHitCount(Integer maximumHitCount) |
void |
setReadOnly(boolean readOnly) |
void |
setSearchTimeout(Long searchTimeout) |
clone, toString, toString
private static final long serialVersionUID
private Integer maximumHitCount
private int hitOffset
private Long searchTimeout
private boolean readOnly
public int hashCode()
hashCode
in class AbstractTransferObject
public boolean equals(Object obj)
equals
in class AbstractTransferObject
public Integer getMaximumHitCount()
SearchCriteria
Query.setMaxResults(int)
in JPA.getMaximumHitCount
in interface SearchCriteria
null
for NO limit.public int getHitOffset()
SearchCriteria
0
by default. By providing a multiple of
SearchCriteria.getMaximumHitCount()
you can simply implement paging. Query.setFirstResult(int)
in JPA.getHitOffset
in interface SearchCriteria
public Long getSearchTimeout()
SearchCriteria
"javax.persistence.query.timeout"
in JPA.getSearchTimeout
in interface SearchCriteria
null
for NO timeout.public void setMaximumHitCount(Integer maximumHitCount)
maximumHitCount
- is the new value of getMaximumHitCount()
.public void setHitOffset(int hitOffset)
hitOffset
- is the new value of getHitOffset()
.public void setSearchTimeout(Long searchTimeout)
searchTimeout
- is the new value of getSearchTimeout()
.public boolean isReadOnly()
SearchCriteria
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.isReadOnly
in interface SearchCriteria
true
if read-only, false
otherwise (default).public void setReadOnly(boolean readOnly)
readOnly
- is the new value of isReadOnly()
.public void limitMaximumHitCount(int limit)
maximum hit count
by the given limit
. If current
maximum hit count
is null
or greater than the given limit
, the value
is replaced by limit
.limit
- is the maximum allowed value for maximum hit count
.Copyright © 2001–2016 mmm-Team. All rights reserved.