public interface Query extends CommOperate
| Modifier and Type | Method and Description |
|---|---|
void |
beginSameConnection()
declare begin Same Connection for some ORM operation.
|
<T> int |
count(T entity)
total number of statistical records.
|
<T> int |
count(T entity,
Condition condition)
total number of statistical records.
|
void |
endSameConnection()
declare end Same Connection for some ORM operation.
|
<T> boolean |
exist(T entity)
Check whether the entity corresponding record exist
|
<T> List<T> |
select(T entity)
According to entity object select records from database.
|
<T> List<T> |
select(T entity,
Condition condition)
Select the records according to entity and condition.
|
<T> List<T> |
select(T entity,
int size)
Select record(s) according to entity object,and can specify page information.
|
<T> List<T> |
select(T entity,
int start,
int size)
Select record(s) according to entity object,and can specify page information.
|
<T> List<T> |
select(T entity,
int start,
int size,
String... selectFields)
Just select some fields,and can specify page information.
|
<T> List<T> |
select(T entity,
String... selectFields)
Just select some fields.
|
<T> T |
selectById(Class<T> entityClass,
Integer id)
Select record by id.
|
<T> T |
selectById(Class<T> entityClazz,
Long id)
Select record by id.
|
<T> T |
selectById(Class<T> entityClass,
String id)
Select record by id.
|
<T> List<T> |
selectByIds(Class<T> entityClass,
String ids)
Select record by id.
|
<T> T |
selectFirst(T entity,
Condition condition)
select the first record.
|
<T> String |
selectJson(T entity)
Select and return data in Json format according to entity object.
|
<T> String |
selectJson(T entity,
Condition condition)
Select and return data in Json format according to entity object.
|
<T> String |
selectJson(T entity,
int start,
int size,
String... selectFields)
Just select some fields,and can specify page information.
|
<T> String |
selectJson(T entity,
String... selectFields)
Just select some fields,and return Json string.
|
<T> T |
selectOne(T entity)
Select one record,if the size do not equal one, return null.
|
<T> List<T> |
selectOrderBy(T entity,
String orderFields)
Select result with order,order type default is:asc
|
<T> List<T> |
selectOrderBy(T entity,
String orderFields,
OrderType[] orderTypes)
Select result with order.
|
<T> List<String[]> |
selectString(T entity)
Select entity,every field will return the string type.
|
<T> List<String[]> |
selectString(T entity,
Condition condition)
Instead of returning data in a entity structure, it uses a character array in List.
|
<T> List<String[]> |
selectString(T entity,
String... selectFields)
Select some field, every field will return the string type.
|
<T> String |
selectWithFun(T entity,
FunctionType functionType,
String fieldForFun)
Select result with one function,Just select one function.
|
<T> String |
selectWithFun(T entity,
FunctionType functionType,
String fieldForFun,
Condition condition)
Select result with one function,just select one function at a time.
|
getDataSourceName, getInterceptorChain, setDataSourceName, setNameTranslateOneTime<T> List<T> select(T entity)
entity - table's entity(do not allow null).<T> List<T> select(T entity, Condition condition)
entity - table's entity(do not allow null).condition - If the field of entity is not null or empty, it will be translate to field=value.Other can define with condition.<T> List<T> select(T entity, int size)
entity - table's entity(do not allow null).
size - fetch result size (>0).<T> List<T> select(T entity, int start, int size)
entity - table's entity(do not allow null).
start - start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).size - fetch result size (>0).<T> List<T> select(T entity, String... selectFields)
entity - table's entity(do not allow null).selectFields - select fields,if more than one,separate with comma in one selectField parameter or use variable parameter.<T> List<T> select(T entity, int start, int size, String... selectFields)
entity - table's entity(do not allow null).start - start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).size - fetch result size (>0).selectFields - select fields,if more than one,separate with comma in one selectField parameter or use variable parameter.<T> List<String[]> selectString(T entity)
entity - table's entity(do not allow null).<T> List<String[]> selectString(T entity, String... selectFields)
entity - table's entity(do not allow null).selectFields - Select fields,if more than one,separate with comma in one selectField parameter or use variable parameter.<T> List<String[]> selectString(T entity, Condition condition)
entity - table's entity(do not allow null).condition - Condition as filter the record.<T> String selectJson(T entity)
entity - table's entity(do not allow null).
<T> T selectOne(T entity)
entity - table's entity(do not allow null).<T> T selectFirst(T entity,
Condition condition)
entity - table's entity(do not allow null).<T> String selectWithFun(T entity, FunctionType functionType, String fieldForFun)
entity - table's entity(do not allow null).functionType - MAX,MIN,SUM,AVG,COUNTfieldForFun - field for function.<T> String selectWithFun(T entity, FunctionType functionType, String fieldForFun, Condition condition)
entity - table's entity(do not allow null).functionType - MAX,MIN,SUM,AVG,COUNTfieldForFun - field for function.condition - Condition as filter the record.
<T> int count(T entity)
entity - table's entity(do not allow null).<T> int count(T entity,
Condition condition)
entity - table's entity(do not allow null).condition - Condition as filter the record.<T> List<T> selectOrderBy(T entity, String orderFields)
entity - table's entity(do not allow null).orderFields - order fields,if more than one,separate with comma.<T> List<T> selectOrderBy(T entity, String orderFields, OrderType[] orderTypes)
entity - table's entity(do not allow null).orderFields - order fields,if more than one,separate with comma.orderTypes - Sort type list.<T> String selectJson(T entity, Condition condition)
entity - table's entity(do not allow null).condition - Condition as filter the record.<T> String selectJson(T entity, String... selectFields)
entity - table's entity(do not allow null).selectFields - select fields,if more than one,separate with comma in one selectField parameter or use variable parameter.<T> String selectJson(T entity, int start, int size, String... selectFields)
entity - table's entity(do not allow null).start - start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).size - fetch result size (>0).selectFields - select fields,if more than one,separate with comma in one selectField parameter or use variable parameter.<T> T selectById(Class<T> entityClass, Integer id)
entityClass - table's entity class(do not allow null).id - value of entity's id field.<T> T selectById(Class<T> entityClazz, Long id)
entityClazz - table's entity class(do not allow null).
id - value of entity's id field.<T> T selectById(Class<T> entityClass, String id)
entityClass - table's entity class(do not allow null).
id - value of entity's id field.<T> List<T> selectByIds(Class<T> entityClass, String ids)
entityClass - table's entity class(do not allow null).
ids - values of entity's id field,if more than one,separate with comma.<T> boolean exist(T entity)
entity - table's entity(do not allow null).void beginSameConnection()
void endSameConnection()
Copyright © 2025. All rights reserved.