public class PrinterMapper extends Object implements IWrapperMapper
| 限定符和类型 | 方法和说明 |
|---|---|
void |
batchCrud(BatchCrud crud)
批量执行增删改操作
传入多个操作时, 需要数据库支持
比如MySql需要在jdbc url链接中附加设置 &allowMultiQueries=true
|
void |
callProcedure(String procedure,
Object parameter)
调用存储过程
|
static void |
clear()
清除线程中的PrinterMapper实例
|
int |
count(IQuery query)
根据 query 条件,查询总记录数
|
int |
countNoLimit(IQuery query)
根据 query 条件(如果有pageOffset, 去掉pageOffset限制部分),查询总记录数
|
int |
delete(IQuery query)
根据wrapper删除记录
|
static IWrapperMapper |
get(IWrapperMapper mapper,
Class eClass)
返回线程中的PrinterMapper
|
int |
insert(IEntity entity)
插入一条记录, 主键字段为空
|
int |
insertBatch(Collection entities)
批量插入数据,实例主键必须全部未赋值
|
int |
insertBatchWithPk(Collection entities)
批量插入数据,实例主键必须全部已赋值
|
int |
insertSelect(String[] fields,
IQuery query)
insert into a_table(fields) select fields from b_table;
|
int |
insertWithPk(IEntity entity)
插入一条记录, 主键字段不为空
|
List |
internalListEntity(IQuery query)
根据 query 条件,查询全部记录
|
static boolean |
isPrint() |
List<Map<String,Object>> |
listMaps(IQuery query)
根据 query 条件,查询全部记录
|
List |
listObjs(IQuery query)
根据 query 条件,查询全部记录
注意: 只返回第一个字段的值
|
IMapping |
mapping()
返回对应的默认构造器
|
static List<String> |
print(int mode,
IMapping mapping,
Consumer<IWrapperMapper>... simulators) |
static IWrapperMapper |
set(int mode,
IMapping mapping)
主动设置PrinterMapper
|
int |
updateBy(IUpdate... updates)
根据update对象更新记录
传入多个Update时, 需要数据库支持
比如MySql需要在jdbc url链接中附加设置 &allowMultiQueries=true
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitemptyQuery, emptyUpdater, entityClass, primaryField, query, updaterdeleteByEntityIds, deleteByEntityIds, deleteById, deleteByIds, deleteByMap, deleteByMapAndDefault, existPk, findById, findOne, findOne, findOne, findOneMap, listByIds, listByIds, listByMap, listByMapAndDefault, listPoJos, listPoJos, logicDelete, logicDeleteByEntityIds, logicDeleteByEntityIds, logicDeleteById, logicDeleteByIds, logicDeleteByMap, logicDeleteByMapAndDefault, save, save, saveOrUpdate, stdPagedEntity, stdPagedMap, stdPagedPoJo, stdPagedPoJo, tagPagedEntity, tagPagedMap, tagPagedPoJo, tagPagedPoJo, updateByIdlistEntitypublic static boolean isPrint()
public int insert(IEntity entity)
IEntityMapperinsert 在接口中 IEntityMapperentity - 实例SqlProvider.insert(Map, ProviderContext),
StatementBuilder.selectKeyStatementOfInsert()public int insertBatch(Collection entities)
IEntityMapperinsertBatch 在接口中 IEntityMapperentities - 实例列表SqlProvider.insertBatch(Map, ProviderContext),
StatementBuilder.selectKeyStatementOfBatchInsert()public int insertWithPk(IEntity entity)
IEntityMapperinsertWithPk 在接口中 IEntityMapperentity - 实例SqlProvider.insertBatchWithPk(Map, ProviderContext)public int insertBatchWithPk(Collection entities)
IEntityMapperinsertBatchWithPk 在接口中 IEntityMapperentities - 实例列表SqlProvider.insertBatchWithPk(Map, ProviderContext)public int insertSelect(String[] fields, IQuery query)
IEntityMapperinsertSelect 在接口中 IEntityMapperfields - 要插入的字段query - select数据SqlProvider.insertSelect(Map, ProviderContext)public int updateBy(IUpdate... updates)
IEntityMapper传入多个Update时, 需要数据库支持 比如MySql需要在jdbc url链接中附加设置 &allowMultiQueries=true
updateBy 在接口中 IEntityMapperupdates - 更新列表SqlProvider.updateBy(Map, ProviderContext)public List internalListEntity(IQuery query)
IEntityMapperinternalListEntity 在接口中 IEntityMapperquery - 实体对象封装操作类(可以为 null)SqlProvider.listEntity(Map, ProviderContext),
StatementBuilder.listEntityStatement(),
ConfigurationKit.ConfigurationKit(Configuration, KeyMap)public List<Map<String,Object>> listMaps(IQuery query)
IEntityMapperlistMaps 在接口中 IEntityMapperquery - 实体对象封装操作类(可以为 null)SqlProvider.listMaps(Map, ProviderContext)public List listObjs(IQuery query)
IEntityMapperlistObjs 在接口中 IEntityMapperquery - 实体对象封装操作类(可以为 null)SqlProvider.listObjs(Map, ProviderContext)public int count(IQuery query)
IEntityMappercount 在接口中 IEntityMapperquery - 实体对象封装操作类 (允许key对应value值为 null)
if value=null then column IS NULL; other column = valueSqlProvider.count(Map, ProviderContext)public int countNoLimit(IQuery query)
IEntityMappercountNoLimit 在接口中 IEntityMapperquery - 实体对象封装操作类(可以为 null)SqlProvider.countNoLimit(Map, ProviderContext)public int delete(IQuery query)
IEntityMapperdelete 在接口中 IEntityMapperquery - 实体对象封装操作类(属性条件可以为null)SqlProvider.delete(Map, ProviderContext)public void batchCrud(BatchCrud crud)
IEntityMapper传入多个操作时, 需要数据库支持 比如MySql需要在jdbc url链接中附加设置 &allowMultiQueries=true
batchCrud 在接口中 IEntityMappercrud - 增删改操作SqlProvider.batchCrud(Map, ProviderContext)public void callProcedure(String procedure, Object parameter)
IEntityMappercallProcedure 在接口中 IEntityMapperprocedure - 存储过程及参数, 比如:
procedureName(#{p.input1, mode=IN, jdbcType=INTEGER}, #{p.output1, mode=OUT, jdbcType=INTEGER})parameter - 存储过程引用的入参和出参设置对象, 以前缀 "p." 引用属性public IMapping mapping()
IWrapperMappermapping 在接口中 IHasMappingmapping 在接口中 IWrapperMapperpublic static IWrapperMapper set(int mode, IMapping mapping)
mode - 打印SQL模式mapping - 原生mapper实例public static void clear()
public static IWrapperMapper get(IWrapperMapper mapper, Class eClass)
public static List<String> print(int mode, IMapping mapping, Consumer<IWrapperMapper>... simulators)
Copyright © 2022. All rights reserved.