public class QueryTableDevice extends Object implements QueryTable, SimplePileline
DEFAULT_CACHE, Keywords, Keywords2, Keywords3| 构造器和说明 |
|---|
QueryTableDevice(Manager manager,
String tableName) |
| 限定符和类型 | 方法和说明 |
|---|---|
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>> consumer) |
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
QueryTable.maps() or QueryTable.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
|
void |
stream(int bufferSize,
Consumer<List<Map<String,Object>>> consumer) |
void |
stream(int bufferSize,
Consumer<Map<String,Object>> rowProcess,
Consumer<List<Map<String,Object>>> consumer) |
void |
stream(int bufferSize,
Function<List<Column>,Object> consumer,
StreamConsumer datas) |
<T> Optional<T> |
unique() |
<T> Optional<T> |
unique(Class<T> cls) |
int |
updateName(String newName)
Modify table name
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitformatSql, getPrimaryKey, getSql, initFetchSize, modifiedTableName, noticeAdd, noticeUpdate, translateParamerInSql, tryReadFromCachepublic QueryTable addCondition(Condition cond)
ConditionAblename is not null addCondition("name", Conditions.IS_NOT_NULL)
addCondition 在接口中 ConditionAbleaddCondition 在接口中 QueryTablepublic QueryTable addCondition(Consumer<List<Condition>> consumer)
addCondition 在接口中 ConditionAbleaddCondition 在接口中 QueryTableconsumer - - conditionspublic QueryTable sort(Sorts sorts, String... fields)
QueryTablesort 在接口中 QueryTablepublic QueryTable setFields(List<String> fields)
setFields 在接口中 QueryTablepublic QueryTable setFields(String... fields)
QueryTablesetFields 在接口中 QueryTablepublic QueryTable setExceptFields(String... fields)
QueryTablesetExceptFields 在接口中 QueryTablepublic <T> Optional<T> unique()
unique 在接口中 QueryTablepublic <T> Optional<T> unique(Class<T> cls)
unique 在接口中 QueryTablepublic int count()
count 在接口中 QueryTablepublic int count(String field)
count 在接口中 QueryTablepublic <T> List<T> list()
QueryTable
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 QueryTable.list(Class) method
The method is equivalent to the integrator of two methods
list 在接口中 QueryTableQueryTable.entities(Class),
QueryTable.maps()public void stream(int bufferSize,
Consumer<Map<String,Object>> rowProcess,
Consumer<List<Map<String,Object>>> consumer)
public void stream(int bufferSize,
Function<List<Column>,Object> consumer,
StreamConsumer datas)
public List<Map<String,Object>> maps()
maps 在接口中 QueryTablepublic List<Map<String,Object>> maps(Map<String,String> alias)
maps 在接口中 QueryTablealias - - Aliased key-value pairs, returned as aliased key-value if matchedpublic int delete()
QueryTabledelete 在接口中 QueryTablepublic QueryTable limit(Integer... args)
QueryTablelimit(0,10)This method is usually followed by a
QueryTable.maps() or QueryTable.list() methodlimit 在接口中 QueryTableargs - - 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 100QueryTablepublic boolean isExsites()
QueryTableisExsites 在接口中 QueryTablepublic int updateName(String newName)
QueryTableupdateName 在接口中 QueryTablepublic int clear()
QueryTableclear 在接口中 QueryTablepublic int drop()
QueryTabledrop 在接口中 QueryTablepublic int addColumn(String columnName, String type)
QueryTableaddColumn 在接口中 QueryTablepublic String copyTo(String newTableName)
copyTo 在接口中 QueryTablepublic <T> List<T> list(Class<T> cls)
list 在接口中 QueryTablepublic <T> List<T> entities(Class<T> cls)
entities 在接口中 QueryTablepublic QueryTable setQualifier(boolean flag)
QueryTablesetQualifier 在接口中 QueryTablepublic QueryTable alias(Map<String,String> alias)
alias 在接口中 QueryTableCopyright © 2023. All rights reserved.