MyBatisPlus各种API
时间:2018-05-28 00:58:21
收藏:0
阅读:4229
// 初始化 成功标识 boolean result = false; // 初始化 User User user = new User(); // 保存 User user.setName("Tom"); result = user.insert(); // 更新 User user.setAge(18); result = user.updateById(); // 查询 User User exampleUser = t1.selectById(); // 查询姓名为‘张三’的所有用户记录 List<User> userList1 = user.selectList( newEntityWrapper<User>().eq("name", "张三") ); // 删除 User result = t2.deleteById();
MyBatisPlus配置结构(参考):
MybatisSqlSessionFactoryBean
typeAliasesPackage
mapperLocations
configuration
globalConfig
plugins
paginationInterceptor
optimisticLockerInterceptor
performanceInterceptor
MybatisConfiguration
GlobalConfiguration
LogicSqlInjector
MapperScannerConfigurer
评论(0)