public class Search extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
Search.Order
order
|
| Constructor and Description |
|---|
Search()
default construct
|
Search(Object value) |
Search(String col,
Collection<?> values)
construct by eq
|
Search(String col,
Object value)
construct by eq
|
Search(String col,
Object[] values)
construct by eq
|
| Modifier and Type | Method and Description |
|---|---|
Search |
and(Search search)
and another search
|
Search |
asc(String col)
order by col asc
|
List<Object> |
assemble()
assemble search to sql and param list
|
<T> T |
attr(String name)
get attrs data
|
Search |
attr(String name,
Object value)
set attr
|
Search |
between(String col,
Object bottom,
Object top)
col between value1 and value2
|
Search |
build(Consumer<ProcArg> builder)
build custom search criterion
|
Search |
clearCriteria()
clear criteria
|
Search |
clearOrders()
clear orders
|
Search |
contains(String col,
String value)
col contains value
|
Search |
desc(String col)
order by col desc
|
Search |
endsWith(String col,
String value)
col ends with value
|
Search |
eq(String col,
Object value)
col eq
|
<T> T |
getAttr(String name)
get attrs data
|
Search |
gt(String col,
Object value)
col is greater than value
|
Search |
gte(String col,
Object value)
col is greater than value or equals value
|
boolean |
hasAttr(String name)
check attrs data
|
boolean |
hasCriterion() |
boolean |
hasCriterion(String col) |
boolean |
hasNoCriterion() |
boolean |
hasNoOrder() |
boolean |
hasOrder() |
Search |
in(String col,
Collection<?> values)
col in values list
|
Search |
in(String col,
Object[] values)
col in values array
|
Search |
isNull(String col)
col is null
|
Search |
like(String col,
String value)
col like value
|
Search |
like(String col,
String value,
boolean wrapValue)
col like value
|
Integer |
limit()
get limit
|
Search |
limit(Integer limit)
set limit
|
Search |
lt(String col,
Object value)
col is less than value
|
Search |
lte(String col,
Object value)
col is less than value or equals value
|
Search |
ne(String col,
Object value)
col not eq value
|
Search |
notBetween(String col,
Object bottom,
Object top)
col not between value1 and value2
|
Search |
notContains(String col,
String value)
col not contains value
|
Search |
notEndsWith(String col,
String value)
col not ends with value
|
Search |
notIn(String col,
Collection<?> values)
col is not not in values
|
Search |
notIn(String col,
Object[] values)
col is not not in values
|
Search |
notLike(String col,
String value)
col not like value
|
Search |
notLike(String col,
String value,
boolean wrapValue)
col not like value
|
Search |
notNull(String col)
col is not null
|
Search |
notStartsWith(String col,
String value)
col not starts with value
|
Integer |
offset()
get offset
|
Search |
offset(Integer offset)
set offset
|
Search |
or(Search search)
or another search
|
Search |
or(String col,
Object value)
or col eq val
|
Search |
orderBy(String col,
Search.Order order)
order by
|
Map<String,String> |
orders() |
Search |
setAttr(String name,
Object value)
set attr
|
Search |
startsWith(String col,
String value)
col starts with value
|
Search |
table(String table)
set table
|
boolean |
trueAttr(String name)
check attr val is true
|
public Search()
public Search(Object value)
value - id valuepublic Search(String col, Object value)
col - col namevalue - valuepublic Search(String col, Collection<?> values)
col - col namevalues - valuespublic Search clearCriteria()
public Search clearOrders()
public Search eq(String col, Object value)
col - col namevalue - valuepublic Search in(String col, Object[] values)
col - col namevalues - valuespublic Search in(String col, Collection<?> values)
col - col namevalues - valuespublic Search like(String col, String value)
col - col namevalue - valuepublic Search like(String col, String value, boolean wrapValue)
col - col namevalue - valuewrapValue - wrap value with %public Search notLike(String col, String value)
col - col namevalue - valuepublic Search notLike(String col, String value, boolean wrapValue)
col - col namevalue - valuewrapValue - wrap value with %public Search contains(String col, String value)
col - col namevalue - valuelike(java.lang.String, java.lang.String)public Search notContains(String col, String value)
col - col namevalue - valuenotLike(java.lang.String, java.lang.String)public Search startsWith(String col, String value)
col - col namevalue - valuelike(java.lang.String, java.lang.String)public Search notStartsWith(String col, String value)
col - col namevalue - valuenotLike(java.lang.String, java.lang.String)public Search endsWith(String col, String value)
col - col namevalue - valuelike(String, String)public Search notEndsWith(String col, String value)
col - col namevalue - valuenotLike(String, String)public Search between(String col, Object bottom, Object top)
col - col namebottom - bottom valuetop - top valuepublic Search notBetween(String col, Object bottom, Object top)
col - col namebottom - bottom valuetop - top valuepublic Search ne(String col, Object value)
col - col namevalue - valuepublic Search notIn(String col, Object[] values)
col - col namevalues - valuespublic Search notIn(String col, Collection<?> values)
col - col namevalues - valuespublic Search lt(String col, Object value)
col - col namevalue - valuepublic Search lte(String col, Object value)
col - col namevalue - valuepublic Search gt(String col, Object value)
col - col namevalue - valuepublic Search gte(String col, Object value)
col - col namevalue - valuepublic Search or(String col, Object value)
col - colvalue - valuepublic Search build(Consumer<ProcArg> builder)
builder - criterion builderpublic Search orderBy(String col, Search.Order order)
col - col nameorder - orderpublic Integer offset()
public Integer limit()
public List<Object> assemble()
public boolean hasCriterion()
public boolean hasCriterion(String col)
col - colpublic boolean hasNoCriterion()
public boolean hasOrder()
public boolean hasNoOrder()
public boolean hasAttr(String name)
name - namepublic boolean trueAttr(String name)
name - attr namepublic <T> T getAttr(String name)
T - data typename - namepublic <T> T attr(String name)
T - data typename - namepublic Search setAttr(String name, Object value)
name - namevalue - valueCopyright © 2020. All rights reserved.