public interface SuidRich extends Suid
| Modifier and Type | Method and Description |
|---|---|
<T> int |
count(T entity)
total number of statistical records.
|
<T> int |
count(T entity,
Condition condition)
total number of statistical records.
|
<T> boolean |
createTable(Class<T> entityClass,
boolean isDropExistTable)
According to the database table generated by JavaBean, JavaBean does not need to configure
too much field information. |
<T> int |
delete(T entity,
IncludeType includeType)
Delete record according to entity.
|
int |
deleteById(Class c,
Integer id)
Delete record by id.
|
int |
deleteById(Class c,
Long id)
Delete record by id.
|
int |
deleteById(Class c,
String ids)
Delete record by id.
|
<T> void |
dropIndex(Class<T> entityClass,
String indexName)
drop index
|
<T> boolean |
exist(T entity)
Check whether the entity corresponding record exist
|
<T> void |
indexNormal(Class<T> entityClass,
String fields,
String indexName)
create normal index
|
<T> int |
insert(List<T> entityList)
Insert records by batch type.
|
<T> int |
insert(List<T> entityList,
int batchSize)
Insert records by batch type.
|
<T> int |
insert(List<T> entityList,
int batchSize,
String excludeFields)
Insert record by batch type,and can point out which field(s) don't need to insert.
|
<T> int |
insert(List<T> entityList,
String excludeFields)
Insert record by batch type,and can point out which field(s) don't need to insert.
|
<T> int |
insert(T[] entity)
Insert records by batch type.
|
<T> int |
insert(T[] entity,
int batchSize)
Insert records by batch type.
|
<T> int |
insert(T[] entity,
int batchSize,
String excludeFields)
Insert record by batch type,and can point out which field(s) don't need to insert.
|
<T> int |
insert(T[] entity,
String excludeFields)
Insert record by batch type,and can point out which field(s) don't need to insert.
|
<T> int |
insert(T entity,
IncludeType includeType)
Insert record according to entity.
|
<T> long |
insertAndReturnId(T entity,
IncludeType includeType)
According to entity object insert record and return id value.
|
<T> void |
primaryKey(Class<T> entityClass,
String fields,
String keyName)
create primaryKey index
|
<T> int |
save(T entity)
save one entity(one record).
|
<T> List<T> |
select(T entity,
IncludeType includeType)
Select record according to entity.
|
<T> List<T> |
select(T entity,
IncludeType includeType,
Condition condition)
Deprecated.
Suid.select(Object,Condition) can set includeType via 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,
IncludeType includeType)
Select and return data in Json format according to entity object.
|
<T> String |
selectJson(T entity,
IncludeType includeType,
Condition condition)
Deprecated.
selectJson(Object,Condition) can set includeType via condition. |
<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.
|
SuidRich |
setDynamicParameter(String para,
String value)
set dynamic parameter for dynamic table & entity name
This method is called earlier than the select, update, insert, delete methods. |
<T> void |
unique(Class<T> entityClass,
String fields,
String indexName)
create unique index
|
<T> int |
update(T entity,
Condition condition)
Update record,and can help with Condition.
|
<T> int |
update(T entity,
Condition condition,
String... updateFields)
Update record, can list update fields.
|
<T> int |
update(T entity,
IncludeType includeType)
Update record according to entity by primary key.
|
<T> int |
update(T entity,
IncludeType includeType,
String... updateFields)
Update record according to entity.
|
<T> int |
update(T entity,
String... updateFields)
Update record, can list update fields.
|
<T> int |
update(T oldEntity,
T newEntity)
Update the entity.
|
<T> int |
updateBy(T entity,
Condition condition,
String... whereFields)
Update record according to whereFields.
|
<T> int |
updateBy(T entity,
IncludeType includeType,
String... whereFields)
Update record according to whereFields.
|
<T> int |
updateBy(T entity,
String... whereFields)
Update record according to whereFields.
|
<T> int |
updateById(T entity,
Condition condition)
it is equivalent to updateBy(entity,"id",condition)
|
beginSameConnection, delete, delete, endSameConnection, insert, insertAndReturnId, select, select, updategetDataSourceName, getInterceptorChain, setDataSourceName, setNameTranslateOneTime<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.<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.<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.<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> int update(T entity,
String... updateFields)
entity - table's entity(do not allow null).updateFields - update fields.
<T> int update(T entity,
IncludeType includeType,
String... updateFields)
entity - table's entity(do not allow null).if id's value is null can not as filter condition.includeType - whether null string and null as a filter conditions.updateFields - update fields.
<T> int insert(T[] entity)
entity - table's entity array(do not allow null).<T> int insert(T[] entity,
int batchSize)
entity - table's entity array(do not allow null).batchSize - batch size.<T> int insert(T[] entity,
String excludeFields)
entity - table's entity array(do not allow null).excludeFields - fields list that don't need to insert .<T> int insert(T[] entity,
int batchSize,
String excludeFields)
entity - table's entity array(do not allow null).batchSize - batch size.excludeFields - Don't insert fields list.<T> int insert(List<T> entityList)
entityList - table's entity list(do not allow null).<T> int insert(List<T> entityList, int batchSize)
entityList - table's entity list(do not allow null).batchSize - batch size.<T> int insert(List<T> entityList, String excludeFields)
entityList - table's entity list(do not allow null).excludeFields - fields list that don't need to insert.<T> int insert(List<T> entityList, int batchSize, String excludeFields)
entityList - table's entity list(do not allow null).batchSize - batch size.excludeFields - Don't insert fields list.<T> List<T> select(T entity, IncludeType includeType)
entity - table's entity(do not allow null).
includeType - whether null string and null as a filter conditions.<T> int update(T entity,
IncludeType includeType)
entity - table's entity(do not allow null),The id field in entity cannot be empty as a filtering condition.includeType - whether null string and null as a filter conditions.<T> int insert(T entity,
IncludeType includeType)
entity - table's entity(do not allow null).includeType - whether null string and null as a filter conditions.<T> long insertAndReturnId(T entity,
IncludeType includeType)
entity - table's entity(do not allow null).
includeType - whether null string and null as a filter conditions.<T> int delete(T entity,
IncludeType includeType)
entity - table's entity(do not allow null).includeType - whether null string and null as a filter conditions.<T> String selectJson(T entity, IncludeType includeType)
entity - table's entity(do not allow null).includeType - whether null string and null as a filter conditions.<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.<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.<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.int deleteById(Class c, Integer id)
c - table's entity class(do not allow null).id - value of entity's id field.int deleteById(Class c, Long id)
c - table's entity class(do not allow null).id - value of entity's id field.int deleteById(Class c, String ids)
c - table's entity class(do not allow null).ids - ids values of entity's id field,if more than one,separate with comma.@Deprecated <T> List<T> select(T entity, IncludeType includeType, Condition condition)
Suid.select(Object,Condition) can set includeType via condition.entity - table's entity(do not allow null).if id's value is null can not as filter condition.includeType - whether null string and null as a filter conditions.condition - Condition as filter the record.@Deprecated <T> String selectJson(T entity, IncludeType includeType, Condition condition)
selectJson(Object,Condition) can set includeType via condition.entity - table's entity(do not allow null).if id's value is null can not as filter condition.includeType - whether null string and null as a filter conditions.condition - Condition as filter the record.<T> String selectJson(T entity, Condition condition)
entity - table's entity(do not allow null).condition - Condition as filter the record.<T> int updateBy(T entity,
String... whereFields)
entity - table's entity(do not allow null).
whereFields - As a field list of where part in SQL, multiple fields are separated by commas
<T> int updateBy(T entity,
IncludeType includeType,
String... whereFields)
entity - table's entity(do not allow null).
includeType - whether null string and null as a filter conditions.whereFields - As a field list of where part in SQL, multiple fields are separated by commas
<T> int updateBy(T entity,
Condition condition,
String... whereFields)
entity - table's entity(do not allow null).
condition - Condition as filter the record.whereFields - As a field list of where part in SQL, multiple fields are separated by commas
<T> int updateById(T entity,
Condition condition)
entity - table's entity(do not allow null).
condition - Condition as filter the record.
<T> int update(T entity,
Condition condition,
String... updateFields)
entity - table's entity(do not allow null).
condition - Condition as filter the record.
updateFields - update fields.The methods setMultiply,setAdd,set in condition are not subject to this restriction.
<T> int update(T entity,
Condition condition)
entity - table's entity(do not allow null).
condition - Condition as filter the record.<T> int update(T oldEntity,
T newEntity)
oldEntity - Entity with old value field.newEntity - Entity with new value field.SuidRich setDynamicParameter(String para, String value)
setDynamicParameter in interface Suidpara - parameter namevalue - parameter value<T> boolean exist(T entity)
entity - table's entity(do not allow null).<T> int save(T entity)
entity - <T> boolean createTable(Class<T> entityClass, boolean isDropExistTable)
entityClass - table's entityClass(do not allow null).isDropExistTable - whether drop the exist table before create<T> void indexNormal(Class<T> entityClass, String fields, String indexName)
entityClass - fields - indexName - <T> void unique(Class<T> entityClass, String fields, String indexName)
entityClass - fields - indexName - <T> void primaryKey(Class<T> entityClass, String fields, String keyName)
entityClass - fields - keyName - Copyright © 2023. All rights reserved.