public interface QueryTable
| 限定符和类型 | 方法和说明 |
|---|---|
QueryTable |
addCondition(Condition cond) |
QueryTable |
addCondition(Consumer<List<Condition>> conds) |
QueryTable |
alias(Map<String,String> alias) |
int |
clear()
Clear the table
|
int |
copyTo(String newTableName) |
int |
count() |
void |
createView(String viewName) |
int |
delete()
Condition deletion, if no condition, is equivalent to clearing the table.
|
int |
drop()
Delete table
|
void |
dropColumn(String column) |
<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) |
<T extends Map<String,Object>> |
map() |
<T extends Map<String,Object>> |
maps() |
<T extends Map<String,Object>> |
maps(Map<String,String> alias) |
int |
rename(String newName)
Modify table name
|
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 |
sort(Sorts sorts,
String... fields)
To add sorting
|
void |
stream(int buffersize,
Consumer<List<? extends Map<String,Object>>> consumer) |
<T> Optional<T> |
unique()
Returns a single result;The return type is automatically determined based on
the constructor, and if you want to return an entity type,
add before that or use
unique(Class) |
<T> Optional<T> |
unique(Class<T> cls)
Returns a single result;The return type is automatically determined based on
the constructor
|
QueryTable addCondition(Condition cond)
QueryTable addCondition(Consumer<List<Condition>> conds)
QueryTable alias(Map<String,String> alias)
QueryTable setFields(String... fields)
fields - QueryTable setFields(List<String> fields)
QueryTable setExceptFields(String... fields)
fields - QueryTable sort(Sorts sorts, String... fields)
sorts - fields - <T> Optional<T> unique()
unique(Class)<T> Optional<T> unique(Class<T> cls)
<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()<T extends Map<String,Object>> List<T> 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 rename(String newName)
newName - int copyTo(String newTableName)
newTableName - int count()
void dropColumn(String column)
void createView(String viewName)
Copyright © 2023. All rights reserved.