public class QueryTableMongodb extends Object implements QueryTable
| 构造器和说明 |
|---|
QueryTableMongodb(Manager<MongoDBTemplate> manager,
String tableName) |
| 限定符和类型 | 方法和说明 |
|---|---|
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
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<? 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
QueryTable.unique(Class) |
<T> Optional<T> |
unique(Class<T> cls)
Returns a single result;The return type is automatically determined based on
the constructor
|
public QueryTableMongodb(Manager<MongoDBTemplate> manager, String tableName)
public void stream(int buffersize,
Consumer<List<? extends Map<String,Object>>> consumer)
stream 在接口中 QueryTablepublic QueryTable addCondition(Condition cond)
addCondition 在接口中 QueryTablepublic QueryTable addCondition(Consumer<List<Condition>> conds)
addCondition 在接口中 QueryTablepublic QueryTable alias(Map<String,String> alias)
alias 在接口中 QueryTablepublic QueryTable setFields(String... fields)
QueryTablesetFields 在接口中 QueryTablepublic QueryTable setFields(List<String> fields)
setFields 在接口中 QueryTablepublic QueryTable setExceptFields(String... fields)
QueryTablesetExceptFields 在接口中 QueryTablepublic QueryTable sort(Sorts sorts, String... fields)
QueryTablesort 在接口中 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 <T> List<T> list(Class<T> cls)
list 在接口中 QueryTablepublic <T> List<T> entities(Class<T> cls)
entities 在接口中 QueryTablepublic <T> Optional<T> unique()
QueryTableQueryTable.unique(Class)unique 在接口中 QueryTablepublic void createView(String viewName)
createView 在接口中 QueryTablepublic <T> Optional<T> unique(Class<T> cls)
QueryTableunique 在接口中 QueryTablepublic <T extends Map<String,Object>> List<T> maps()
maps 在接口中 QueryTablepublic <T extends Map<String,Object>> List<T> maps(Map<String,String> alias)
maps 在接口中 QueryTablealias - - Aliased key-value pairs, returned as aliased key-value if
matchedpublic 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 int delete()
QueryTabledelete 在接口中 QueryTablepublic boolean isExsites()
QueryTableisExsites 在接口中 QueryTablepublic int clear()
QueryTableclear 在接口中 QueryTablepublic int drop()
QueryTabledrop 在接口中 QueryTablepublic int rename(String newName)
QueryTablerename 在接口中 QueryTablepublic int copyTo(String newTableName)
copyTo 在接口中 QueryTablepublic int count()
count 在接口中 QueryTablepublic void dropColumn(String column)
dropColumn 在接口中 QueryTableCopyright © 2023. All rights reserved.