public interface QueryTable extends ConditionAble, Stream
| 限定符和类型 | 方法和说明 |
|---|---|
int |
addColumn(String columnName,
String type)
Add fields to the table
|
QueryTable |
addCondition(Condition cond)
Add the query condition, which does not require value,
eg: name is not null addCondition("name",
Conditions.IS_NOT_NULL) |
QueryTable |
addCondition(Consumer<List<Condition>> conds) |
QueryTable |
alias(Map<String,String> alias) |
int |
clear()
Clear the table
|
String |
copyTo(String newTableName) |
int |
count() |
int |
count(String field) |
int |
delete()
Condition deletion, if no condition, is equivalent to clearing the table.
|
int |
drop()
Delete table
|
<T> List<T> |
entities(Class<T> cls) |
boolean |
isExsites()
Determine whether the table exists.
|
QueryTable |
limit(Integer... args)
This is a extraction function limit(0,10) This
method is usually followed by a
maps() or list() methodDifferent databases will have different implementations, so refer to the database functions you're currently using, and if you don't support limit, you'll default to pulling the corresponding result set from the result set |
<T> List<T> |
list()
If you need to return a result set instead of a single item; The return type
is automatically determined by the constructor.
|
<T> List<T> |
list(Class<T> cls) |
Optional<Map<String,Object>> |
map() |
Optional<Map<String,Object>> |
map(Map<String,String> alias) |
List<Map<String,Object>> |
maps() |
List<Map<String,Object>> |
maps(Map<String,String> alias) |
QueryTable |
setExceptFields(String... fields)
All other fields are involved
|
QueryTable |
setFields(List<String> fields) |
QueryTable |
setFields(String... fields)
Sets the fields that participate in the operation, with the highest
priority to override the fields of the entity class
|
QueryTable |
setQualifier(boolean flag)
Whether the qualifier is turned on or not, it is turned on by default
|
QueryTable |
sort(Sorts sorts,
String... fields)
To add sorting
|
<T> Optional<T> |
unique() |
<T> Optional<T> |
unique(Class<T> cls) |
int |
updateName(String newName)
Modify table name
|
QueryTable addCondition(Condition cond)
ConditionAblename is not null addCondition("name", Conditions.IS_NOT_NULL)
addCondition 在接口中 ConditionAbleQueryTable addCondition(Consumer<List<Condition>> conds)
addCondition 在接口中 ConditionAbleconds - - conditionsQueryTable alias(Map<String,String> alias)
QueryTable setFields(List<String> fields)
QueryTable setFields(String... fields)
fields - QueryTable setExceptFields(String... fields)
fields - QueryTable sort(Sorts sorts, String... fields)
sorts - fields - <T> Optional<T> unique()
<T> List<T> list()
If you need to return a result set instead of a single item; The return type
is automatically determined by the constructor. If you want to return an
entity type, add the entity type before the list(Class) method
The method is equivalent to the integrator of two methods
entities(Class),
maps()List<Map<String,Object>> maps(Map<String,String> alias)
alias - - Aliased key-value pairs, returned as aliased key-value if matchedQueryTable limit(Integer... args)
limit(0,10)This method is usually followed by a
maps() or list() methodargs - - If you're using MYSQL or ORACLE or SQLITE
you can go to limit(0,100), if you're using
SQLSERVER you'll go to limit(100) and it'll convert
to top 100QueryTableint delete()
boolean isExsites()
int clear()
int drop()
int updateName(String newName)
newName - int addColumn(String columnName, String type)
columnName - type - QueryTable setQualifier(boolean flag)
flag - int count()
int count(String field)
Copyright © 2023. All rights reserved.