• HOME
  • SEARCH
  • TOPICS
  • DATA

  • Spring Boot MyBatis 返回 Map 类型

    @MapKey MyBatis中提供了注解@MapKey,将结果集映射成HashMap。 举例 原先返回List<User>,使用@MapKey后返回Map<String, User>。 注意:@M

    2024-12-30, Views: 747 , Topics: MyBatis MyBatis-Plus Spring Boot

  • MyBatis-Plus 自定义多数据源注解

    说明 dynamic-datasource自带了@Master和@Slave注解。 自定义注解 application.yaml配置,datasource下申明需要自定义的注解对应的数据库名称。 s

    2024-12-17, Views: 505 , Topics: MyBatis-Plus

  • Spring Boot 3 MyBatis-Plus 多数据源实现懒加载 continue on error

    说明 Spring Boot 3没移除了spring.datasource.continue-on-error的配置,在启动时如果无法连接数据库则程序将抛出异常并且结束进程。 需求 在本地开发时,配

    2024-12-12, Views: 722 , Topics: MyBatis-Plus

  • MyBatis-Plus 使用 TableInfoHelper 和 LambdaUtils 获取表字段及信息

    TableInfoHelper getTableInfo获取表信息,getFieldList获取表字段信息。 TableInfo tableInfo = TableInfoHelper.getTab

    2024-10-31, Views: 1358 , Topics: MyBatis-Plus

  • MyBatis-Plus 多个动态 where 条件

    场景 在编写自定义SQL时,可能会有子查询,所以出现多个where条件的情况。 限制 目前MyBatis-Plus只支持一个自定义参数ew。 改造 假设2个where条件的SQL。 处理 Wrapp

    2024-10-30, Views: 823 , Topics: MyBatis-Plus

  • MyBatis-Plus 使用多数据源实现读写分离

    添加依赖 添加多数据源依赖 <dependency> <groupId>com.baomidou</groupId> <artifactId>dynamic-datasource-s

    2024-10-29, Views: 736 , Topics: MyBatis-Plus

  • MyBatis-Plus 分页插件

    开启插件 @Configuration public class MybatisPlusConfig { /** * 添加分页插件 */ @Bean p

    2024-10-28, Views: 753 , Topics: MyBatis-Plus

  • MyBatis-Plus lambdaUpdate 更新 FieldFill.UPDATE 字段

    FieldFill.UPDATE 基类中定义了fill = FieldFill.UPDATE,更新时自动填充的字段。 @Getter @Setter @ToString public abstrac

    2024-10-25, Views: 1076 , Topics: MyBatis-Plus

  • MyBatis-Plus 动态选择需要查询的列

    sqlSelect Wrapper对象中有sqlSelect方法可以获取MyBatis-Plus组织后的select列。 在xml或@Select等语句中可以使用${ew.sqlSelect}。 @

    2024-10-24, Views: 676 , Topics: MyBatis-Plus

  • MyBatis-Plus 动态 where 条件

    customSqlSegment Wrapper对象中有customSqlSegment方法可以获取MyBatis-Plus组织后的where条件。 在xml或@Select等语句中可以使用${ew

    2024-10-23, Views: 913 , Topics: MyBatis-Plus

  • Spring Boot MyBatis 及 MyBatis-Plus 禁用一级缓存

    场景 在同一个session中(大多场景是同一次请求中),需要多次执行相同的查询语句,来判断是否有数据变更。 一级缓存 在以上场景下,MyBatis/MyBatis-Plus因为默认开启了一级缓存,

    2024-08-29, Views: 1350 , Topics: MyBatis MyBatis-Plus Spring Boot

  • Spring Boot MyBatis 及 MyBatis-Plus 打印执行 SQL 语句

    方式一(推荐) application.yaml配置文件中添加相关配置。 MyBatis mybatis: configuration: log-impl: org.apache.iba

    2024-08-28, Views: 1686 , Topics: MyBatis MyBatis-Plus Spring Boot

  • Spring Boot MyBatis-Plus null 字段处理策略

    null 字段 MyBatis-Plus对于对象中为null的字段,默认是不会在insert和update时加入到SQL语句的。 如果需要包括对null字段的处理,则需要显式的调用UpdateWra

    2024-05-23, Views: 912 , Topics: MyBatis-Plus Spring Boot

  • Spring Boot MyBatis-Plus 查询逻辑删除的数据

    需求 MyBatis-Plus全局配置了逻辑删除,所有SQL都会自动带上逻辑删除的where,现在有一张表需要查询出所有数据(包括逻辑删除的数据)。 说明 MyBatis-Plus官方文档中有一段附

    2024-05-22, Views: 2847 , Topics: MyBatis-Plus Spring Boot

  • Spring Boot MyBatis-Plus 多数据源导致工程无法启动

    错误日志 *************************** APPLICATION FAILED TO START *************************** Descripti

    2024-04-22, Views: 1607 , Topics: Spring Boot MyBatis-Plus

  • Spring Boot MyBatis-Plus apply 自定义 where 条件

    需求 对于PostgreSQL中的数组类型,需要定制化SQL。 LambdaQueryWrapper 使用LambdaQueryWrapper的apply方法,自定义SQL。 查询Post表中top

    2024-04-19, Views: 1689 , Topics: Spring Boot MyBatis-Plus

  • Prev
  • 1
  • Next

©2025 沪ICP备18012661号-1 阿里云

Messages Sitemap GitHub