public abstract class ObjSQLRichAbstractServiceImpl extends ObjSQLAbstractServiceImpl implements ObjSQLRichService
| Constructor and Description |
|---|
ObjSQLRichAbstractServiceImpl() |
| 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
|
abstract SuidRich |
getSuidRich() |
<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 excludeFieldList)
Insert record by batch type,and can point out which field(s) don't need to insert.
|
<T> int |
insert(T[] entity,
String excludeFieldList)
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,
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> entityClass,
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,
int start,
int size,
String... selectField)
Just select some fields,and can specify page information.
|
<T> String |
selectJson(T entity,
String... selectField)
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 orderFieldList)
Select result with order,order type default is:asc
|
<T> List<T> |
selectOrderBy(T entity,
String orderFieldList,
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,only effective once
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... updateFieldList)
Update record according to entity.
|
<T> int |
update(T entity,
String... updateFieldList)
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, getDataSourceName, getInterceptorChain, getSuid, insert, insertAndReturnId, select, select, setDataSourceName, setNameTranslateOneTime, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbeginSameConnection, delete, delete, endSameConnection, insert, insertAndReturnId, select, select, updategetDataSourceName, getInterceptorChain, setDataSourceName, setNameTranslateOneTimepublic abstract SuidRich getSuidRich()
public <T> List<T> select(T entity, int size)
SuidRichselect in interface SuidRichentity - table's entity(do not allow null).
size - fetch result size (>0).public <T> List<T> select(T entity, int start, int size)
SuidRichselect in interface SuidRichentity - 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).public <T> List<T> select(T entity, int start, int size, String... selectFields)
SuidRichselect in interface SuidRichentity - 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.public <T> List<T> select(T entity, String... selectFields)
SuidRichpublic <T> int insert(T[] entity)
SuidRichpublic <T> int insert(T[] entity,
String excludeFieldList)
SuidRichpublic <T> int insert(T[] entity,
int batchSize)
SuidRichpublic <T> int insert(T[] entity,
int batchSize,
String excludeFieldList)
SuidRichpublic <T> int update(T entity,
String... updateFieldList)
SuidRichupdate in interface SuidRichentity - table's entity(do not allow null).updateFieldList - update fields.
public <T> T selectOne(T entity)
SuidRichpublic <T> T selectFirst(T entity,
Condition condition)
SuidRichselectFirst in interface SuidRichentity - table's entity(do not allow null).public <T> String selectWithFun(T entity, FunctionType functionType, String fieldForFun)
SuidRichselectWithFun in interface SuidRichentity - table's entity(do not allow null).functionType - MAX,MIN,SUM,AVG,COUNTfieldForFun - field for function.public <T> String selectWithFun(T entity, FunctionType functionType, String fieldForFun, Condition condition)
SuidRichselectWithFun in interface SuidRichentity - table's entity(do not allow null).functionType - MAX,MIN,SUM,AVG,COUNTfieldForFun - field for function.condition - Condition as filter the record.
public <T> int count(T entity)
SuidRichpublic <T> int count(T entity,
Condition condition)
SuidRichpublic <T> List<T> selectOrderBy(T entity, String orderFieldList)
SuidRichselectOrderBy in interface SuidRichentity - table's entity(do not allow null).orderFieldList - order fields,if more than one,separate with comma.public <T> List<T> selectOrderBy(T entity, String orderFieldList, OrderType[] orderTypes)
SuidRichselectOrderBy in interface SuidRichentity - table's entity(do not allow null).orderFieldList - order fields,if more than one,separate with comma.orderTypes - Sort type list.public <T> int update(T entity,
IncludeType includeType,
String... updateFieldList)
SuidRichupdate in interface SuidRichentity - 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.updateFieldList - update fields.
public <T> List<T> select(T entity, IncludeType includeType)
SuidRichselect in interface SuidRichentity - table's entity(do not allow null).
includeType - whether null string and null as a filter conditions.public <T> int update(T entity,
IncludeType includeType)
SuidRichupdate in interface SuidRichentity - 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.public <T> int insert(T entity,
IncludeType includeType)
SuidRichpublic <T> int delete(T entity,
IncludeType includeType)
SuidRichpublic <T> List<String[]> selectString(T entity)
SuidRichselectString in interface SuidRichentity - table's entity(do not allow null).public <T> List<String[]> selectString(T entity, String... selectFields)
SuidRichselectString in interface SuidRichentity - 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.public <T> String selectJson(T entity)
SuidRichselectJson in interface SuidRichentity - table's entity(do not allow null).
public <T> String selectJson(T entity, IncludeType includeType)
SuidRichselectJson in interface SuidRichentity - table's entity(do not allow null).includeType - whether null string and null as a filter conditions.public <T> T selectById(Class<T> entityClass, Integer id)
SuidRichselectById in interface SuidRichentityClass - table's entity class(do not allow null).id - value of entity's id field.public <T> T selectById(Class<T> entityClass, Long id)
SuidRichselectById in interface SuidRichentityClass - table's entity class(do not allow null).
id - value of entity's id field.public <T> T selectById(Class<T> entityClass, String id)
SuidRichselectById in interface SuidRichentityClass - table's entity class(do not allow null).
id - value of entity's id field.public <T> List<T> selectByIds(Class<T> entityClass, String ids)
SuidRichselectByIds in interface SuidRichentityClass - table's entity class(do not allow null).
ids - values of entity's id field,if more than one,separate with comma.public int deleteById(Class c, Integer id)
SuidRichdeleteById in interface SuidRichc - table's entity class(do not allow null).id - value of entity's id field.public int deleteById(Class c, Long id)
SuidRichdeleteById in interface SuidRichc - table's entity class(do not allow null).id - value of entity's id field.public int deleteById(Class c, String ids)
SuidRichdeleteById in interface SuidRichc - table's entity class(do not allow null).ids - ids values of entity's id field,if more than one,separate with comma.public <T> String selectJson(T entity, Condition condition)
SuidRichselectJson in interface SuidRichentity - table's entity(do not allow null).condition - Condition as filter the record.public <T> int updateBy(T entity,
String... whereFields)
SuidRichupdateBy in interface SuidRichentity - table's entity(do not allow null).
whereFields - As a field list of where part in SQL, multiple fields can separated by commas in one
public <T> int updateBy(T entity,
IncludeType includeType,
String... whereFields)
SuidRichupdateBy in interface SuidRichentity - 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 can separated by commas in one
public <T> int updateBy(T entity,
Condition condition,
String... whereFields)
SuidRichupdateBy in interface SuidRichentity - 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 can separated by commas in one
public <T> int updateById(T entity,
Condition condition)
SuidRichupdateById in interface SuidRichentity - table's entity(do not allow null).
condition - Condition as filter the record.
public <T> int update(T entity,
Condition condition,
String... updateFields)
SuidRichupdate in interface SuidRichentity - 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.
public <T> int update(T entity,
Condition condition)
SuidRichupdate in interface SuidRichentity - table's entity(do not allow null).
condition - Condition as filter the record.public <T> int insert(List<T> entityList)
SuidRichpublic <T> int insert(List<T> entityList, int batchSize)
SuidRichpublic <T> int insert(List<T> entityList, String excludeFields)
SuidRichpublic <T> int insert(List<T> entityList, int batchSize, String excludeFields)
SuidRichpublic <T> List<String[]> selectString(T entity, Condition condition)
SuidRichselectString in interface SuidRichentity - table's entity(do not allow null).condition - Condition as filter the record.public SuidRich setDynamicParameter(String para, String value)
SuidsetDynamicParameter in interface SuidsetDynamicParameter in interface SuidRichsetDynamicParameter in class ObjSQLAbstractServiceImplpara - parameter namevalue - parameter valuepublic <T> boolean exist(T entity)
SuidRichpublic <T> int update(T oldEntity,
T newEntity)
SuidRichupdate in interface SuidRicholdEntity - Entity with old value field.newEntity - Entity with new value field.some fields(serialVersionUID,have annotation JoinTable or Ignore, value is null) would be ignored.public <T> String selectJson(T entity, String... selectField)
SuidRichselectJson in interface SuidRichentity - table's entity(do not allow null).selectField - select fields,if more than one,separate with comma in one selectField parameter or use variable parameter.public <T> String selectJson(T entity, int start, int size, String... selectField)
SuidRichselectJson in interface SuidRichentity - 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).selectField - select fields,if more than one,separate with comma in one selectField parameter or use variable parameter.public <T> int save(T entity)
SuidRichpublic <T> long insertAndReturnId(T entity,
IncludeType includeType)
SuidRichinsertAndReturnId in interface SuidRichentity - table's entity(do not allow null).
includeType - whether null string and null as a filter conditions.public <T> boolean createTable(Class<T> entityClass, boolean isDropExistTable)
SuidRichcreateTable in interface SuidRichentityClass - table's entityClass(do not allow null).isDropExistTable - whether drop the exist table before createpublic <T> void indexNormal(Class<T> entityClass, String fields, String indexName)
SuidRichindexNormal in interface SuidRichpublic <T> void unique(Class<T> entityClass, String fields, String indexName)
SuidRichpublic <T> void primaryKey(Class<T> entityClass, String fields, String keyName)
SuidRichprimaryKey in interface SuidRichCopyright © 2025. All rights reserved.