ShardingSphere 5.3 系列升级解读:Spring 配置升级指南

AI权益加码!Claude Code、Cursor等20+工具免费用! 购周边限时加赠Coding Plan Lite,畅享主流AI工具!学习进阶更高效! 阅读详情

背景

在 5.3.0 版本以前,ShardingSphere-JDBC 同时支持 Java API、YAML、Spring Boot Starter 和 Spring Namespace 等配置方式。其中,为兼容 Spring 的配置方式,给社区带来了以下难题:

  • 当新增或更新 API 时,需要调整多项配置文件,工作量大。

  • 社区需要维护多重配置文档 & 示例。

  • Spring Bean 生命周期管理易受项目其他依赖的影响:如 PostProcessor 无法正常执行 [1][2]。

  • Spring Boot Starter & Spring Namespace 配置风格与 ShardingSphere 标准的 YAML 存在着较大差别。

  • Spring Boot Starter 和 Spring Namespace 受 Spring 版本影响,带来额外的配置兼容性问题。

例如在最新发版的 Spring Boot 3.0.0 中,移除了对 2.x 版本 spring.factories 的支持 [3][4],这为想要升级但正在使用 ShardingSphere Spring Boot Starter 的用户带来了挑战,而升级 Spring Boot 依赖也会为 ShardingSphere 用户带来新的兼容性问题。基于以上考虑,ShardingSphere 社区决定在 ShardingSphere 5.3.0 Release 中移除 Spring 全部依赖和配置支持。

那么,对需要使用 Spring Boot 或 Spring Namespace  的 ShardingSphere-JDBC 用户,应当如何接入 ShardingSphere?原有的用户怎样升级呢?本文将为您解答这些疑问。

影响范围

为方便正在使用以下功能的用户来评估升级影响,我们梳理了此次调整的影响范围:

ShardingSphere Spring Boot Starter 

ShardingSphere Spring Namespace

Maven 坐标

升级到 ShardingSphere 5.3.0 或更高的版本,原有 Spring 相关的依赖坐标将会失效。

<dependency>
    <groupId>org.apache.shardingsphere</groupId>
    <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
    <version>${shardingsphere.version}</version>
</dependency>

<dependency>
    <groupId>org.apache.shardingsphere</groupId>
    <artifactId>shardingsphere-jdbc-core-spring-namespace</artifactId>
    <version>${shardingsphere.version}</version>
</dependency>

调整为

<dependency>
    <groupId>org.apache.shardingsphere</groupId>
    <artifactId>shardingsphere-jdbc-core</artifactId>
    <version>${shardingsphere.version}</version>
</dependency>

自定义算法

移除 Spring 模块会同时移除 AlgorithmProvided 相关类。若此前用户在自定义算法中有使用到 Bean 注入相关的逻辑,更新后将失效。对需要在算法中使用 Spring Bean 的场景,需开发者主动管理。

事务

同时移除,用于支持方法级别事务声明的 @ShardingSphereTransactionType 注解。若用户有在方法级别更改事务类型的需求,请使用 Java API[5] 方式。

配置文件

在升级 5.3.0 版本后,原有的 Spring Boot Starter 或 Spring Namespace 数据源配置将会失效。具体的配置升级方式,请参考下一章节。

升级指导

ShardingSphereDriver

从 5.1.2 版本开始,工程师无需修改代码。ShardingSphere-JDBC 提供了原生 JDBC 驱动 ShardingSphereDriver,工程师仅通过配置即可接入使用,通过这种接入方式:‍

可以更加统一 ShardingSphere-JDBC 和 ShardingSphere-Proxy 的配置文件格式,只需少量修改即可复用,详情见用户手册-JDBC 驱动[6]。在升级到 5.3.x 版本后,使用 Spring Boot Starter 或 Spring Namespace 的用户:‍

推荐使用 ShardingSphereDriver 方式来接入 ShardingSphere-JDBC。

正在使用 Spring Boot Starter 如何升级

升级前

在 application.yml 中,ShardingSphere 相关的配置如下:

application.yml
spring:
  shardingsphere:
    database:
      name: sharding_db
    datasource:
      names: ds_0,ds_1
      ds_0:
        type: com.zaxxer.hikari.HikariDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver
        jdbc-url: jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
        username: root
        password:
      ds_1:
        type: com.zaxxer.hikari.HikariDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver
        jdbc-url: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
        username: root
        password:
    rules:
      sharding:
        default-database-strategy:
          standard:
            sharding-column: id
            sharding-algorithm-name: database_inline
        tables:
          t_order:
            actual-data-nodes: ds_$->{0..1}.t_order_$->{0..1}
            table-strategy:
              standard:
                sharding-column: count
                sharding-algorithm-name: t_order_inline
        sharding-algorithms: 
          database_inline:
            type: INLINE
            props:
              algorithm-expression: ds_$->{user_id % 2}
          t_order_inline:
            type: INLINE
            props:
              algorithm-expression: t_order_$->{order_id % 2}
    props:
      sql-show: true

升级后

在 resources 目录下新建  YAML 配置文件,如 sharding.yaml,并按照用户手册-YAML配置 [7] 改写原有配置内容。

sharding.yaml
dataSources:
  ds_0:
    dataSourceClassName: com.zaxxer.hikari.HikariDataSource
    driverClassName: com.mysql.jdbc.Driver
    jdbcUrl: jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
    username: root
    password:
  ds_1:
    dataSourceClassName: com.zaxxer.hikari.HikariDataSource
    driverClassName: com.mysql.jdbc.Driver
    jdbcUrl: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
    username: root
    password:

rules:
- !SHARDING
  tables:
    t_order:
      actualDataNodes: ds_$->{0..1}.t_order_$->{0..1}
      tableStrategy:
        standard:
          shardingColumn: count
          shardingAlgorithmName: t_order_inline
  defaultDatabaseStrategy:
    standard:
      shardingColumn: id
      shardingAlgorithmName: database_inline
  shardingAlgorithms:
    database_inline:
      type: INLINE
      props:
        algorithm-expression: ds_$->{user_id % 2}
    t_order_inline:
      type: INLINE
      props:
        algorithm-expression: t_order_$->{order_id % 2}

props:
  sql-show: true

如果以集群模式部署,当对应 namespace 已有所需配置:sharding.yaml 中仅配置 mode 即可

mode:
  type: Cluster
  repository:
    type: ZooKeeper
    props:
      namespace: governance_ds
      server-lists: localhost:2181
      retryIntervalMilliseconds: 500
      timeToLiveSeconds: 60
      maxRetries: 3
      operationTimeoutMilliseconds: 500
application.yml

将原有的 ShardingSphere 相关配置替换为 ShardingSphereDriver 配置项:

spring:
  datasource:
    driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
    url: jdbc:shardingsphere:classpath:sharding.yaml

正在使用 Spring Namespace 如何升级

升级前

spring-sharding.xml
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
       xmlns:sharding="http://shardingsphere.apache.org/schema/shardingsphere/sharding"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans.xsd 
                           http://www.springframework.org/schema/tx 
                           http://www.springframework.org/schema/tx/spring-tx.xsd
                           http://www.springframework.org/schema/context 
                           http://www.springframework.org/schema/context/spring-context.xsd
                           http://shardingsphere.apache.org/schema/shardingsphere/datasource
                           http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd
                           http://shardingsphere.apache.org/schema/shardingsphere/sharding
                           http://shardingsphere.apache.org/schema/shardingsphere/sharding/sharding.xsd
                           ">

    <bean id="ds_0" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <property name="jdbcUrl" value="jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&amp;useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>
        <property name="username" value="root"/>
        <property name="password" value=""/>
    </bean>
    
    <bean id="ds_1" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <property name="jdbcUrl" value="jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&amp;useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>
        <property name="username" value="root"/>
        <property name="password" value=""/>
    </bean>
    
    <sharding:standard-strategy id="databaseStrategy" sharding-column="user_id" algorithm-ref="inlineStrategyShardingAlgorithm" />

    <sharding:sharding-algorithm id="inlineStrategyShardingAlgorithm" type="INLINE">
        <props>
            <prop key="algorithm-expression">ds_${user_id % 2}</prop>
        </props>
    </sharding:sharding-algorithm>
    
    <sharding:standard-strategy id="orderTableStrategy" sharding-column="order_id" algorithm-ref="orderTableAlgorithm" />
    
    <sharding:sharding-algorithm id="orderTableAlgorithm" type="INLINE">
        <props>
            <prop key="algorithm-expression">t_order_${order_id % 2}</prop>
        </props>
    </sharding:sharding-algorithm>
    
    <sharding:rule id="shardingRule">
        <sharding:table-rules>
            <sharding:table-rule logic-table="t_order" database-strategy-ref="databaseStrategy" table-strategy-ref="orderTableStrategy" />
        </sharding:table-rules>
    </sharding:rule>
    
    <shardingsphere:data-source id="shardingDataSource" database-name="sharding-databases" data-source-names="ds_0,ds_1" rule-refs="shardingRule" >
        <props>
            <prop key="sql-show">true</prop>
        </props>
    </shardingsphere:data-source>
</beans>

升级后

sharding.yaml

新增 sharding.yaml 配置文件,格式同 Spring Boot 示例中一致。

spring-sharding.xml

spring-sharding.xml 中移除原有 ShardingSphere 配置,替换为 ShardingSphereDriver 配置内容。

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
                           http://www.springframework.org/schema/beans/spring-beans.xsd">
    
    <bean id="shardingDataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
        <property name="driverClass" value="org.apache.shardingsphere.driver.ShardingSphereDriver" />
        <property name="url" value="jdbc:shardingsphere:classpath:sharding.yaml" />
    </bean>
</beans>

🎉 完成以上配置,即可畅享

ShardingSphere-JDBC 全新版本!

结语 & 参考🔗‍

此次升级,大大减少了 ShardingSphere-JDBC 和 ShardingSphere-Proxy 在配置方面的差异,为 ShardingSphere-JDBC 用户顺利过渡到 ShardingSphere 集群架构打好了基础,在 API 标准化、提升配置兼容性方面迈出了坚实的一步。

对于新用户而言,ShardingSphereDriver 的配置方式也能减少配置侵入性,上手更简单。此后,Apache ShardingSphere 社区也能更好的专注于自身功能迭代,为用户和开发者带来更多更好的特性。

以上就是本次分享的全部内容,关于配置升级的更多信息,请参考官网用户手册 [8]。若读者对 ShardingSphere 有任何疑问或建议,欢迎在 GitHub issue 列表 [9] 提出,或可前往中文社区  [10] 交流讨论。

[1] issue: ShardingSphereAlgorithmPostProcessor.init() https://github.com/apache/shardingsphere/issues/18093
[2] issue: ShardingSphere Bean is not eligible for getting processed by all BeanPostProcessors https://github.com/apache/shardingsphere/issues/11650
[3] Spring Boot: Remove spring.factories auto-configuration support https://github.com/spring-projects/spring-boot/issues/29699
[4] issue: spring boot 3.0.0-M5 Failed to determine a suitable driver class https://github.com/apache/shardingsphere/issues/21225
[5] 用户手册-分布式事务 https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-jdbc/special-api/transaction/java-api/
[6] 用户手册-JDBC 驱动 https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-jdbc/yaml-config/jdbc-driver/
[7] 用户手册-YAML 配置 https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-jdbc/yaml-config/
[8] 用户手册:https://shardingsphere.apache.org/document/current/cn/user-manual/
[9] GitHub issue 列表:https://github.com/apache/shardingsphere/issues
[10] 中文社区:https://community.sphere-ex.com/
ShardingSphere-JDBC-若依框架集成(SpringBoot ShardingSphere基础知识、ShardingSphere-JDBC如何集成进若依框架中 使用的是若依框架前后端版本、动态数据源,可自行切换,默认数据源为达梦8代理端, 阅读详情

相关推荐

shardingsphere-jdbc 整合 springboot

shardingsphere-jdbc 整合 springboot 实现水平分表。

方圆师兄 1859

MySQL 分库分表实践:Spring Boot + ShardingSphere

至此,我们就完成 Spring Boot + ShardingSphere 的 MySQL 分库分表实践。商品订单的分库分表是一个很典型的案例,也是工作中遇到的常见场景。当然,实际业务也可能遇到不同的分库分表策略,比如按照日期分库分表的,不过这些都可以编写分片算法来解决。实际上,如果对 MySQL 分库分表理论基础,和 ShardingSphere 的原理及核心概念有一定的学习了解,业务开发中遇到的分库分表都相信可以很轻松地应对。

sc35262的博客 1641

sharding-jdbc-spring-boot-starter最简单使用

前言 网上已经有很多的关于sharding-jdbc的使用,但是很多都是抄来抄去,说的也不是特别的完整,作者本来是闲来无事想跑起来试一下效果,但是找了一些文档都不是说的很明白。而且很多都是使用的是sharding-jdbc-core ,但是我们现在开发应该很少用spring mvc开发吧,大部分都是springboot开发,所以还是想用starter的方式。经历不断试错后搭建起最简单的、配置代码最少的测试案例。如果帮助到了你帮忙点赞啊。 一、引入依赖 mybatis-spring-boot-starte

segegefe的博客 1742

SpringBoot 2 种方式快速实现分库分表,轻松拿捏!

是一款开源的分布式关系型数据库中间件,为Apache的顶级项目。其前身是和的两个独立项目,后来在 2018 年合并成了一个项目,并正式更名为 ShardingSphere。其中 sharding-jdbc 为整个生态中最为经典和成熟的框架,最早接触分库分表的人应该都知道它,是学习分库分表的最佳入门工具。

竹林幽深 4057

Sharding-JDBC(八)5.3 系列升级解读

Sharding-JDBC(八)5.3 系列升级解读

ACGkaka的博客 1703

ShardingSphere数据加密规则配置详解:从原理到实战避坑指南

数据加密是保障数据安全的核心技术,其原理在于通过特定算法将明文信息转换为不可读的密文,防止未授权访问。在数据库层面实现透明加密,能有效平衡安全性与开发效率,避免业务代码的侵入式改造。Apache ShardingSphere作为分布式数据库中间件,其数据加密模块通过在JDBC驱动层拦截SQL,实现了对敏感数据的自动加密存储与透明解密查询,为数据安全合规提供了声明式解决方案。该方案尤其适用于需要满足GDPR等数据安全法规、保护用户隐私信息的金融、电商等应用场景。本文聚焦于ShardingSphere数据加密规

cucanqi9387的博客 485

MySQL分库分表实战:从核心原理到ShardingSphere-JDBC实现

数据库水平扩展是应对海量数据和高并发场景的核心技术。其基本原理是通过数据分片,将集中式的数据存储与访问压力分散到多个物理节点,从而突破单机在IO、CPU和连接数上的瓶颈,实现系统吞吐量的线性提升和查询延迟的降低。这项技术对于构建高性能、高可用的互联网应用具有关键价值,广泛应用于电商、社交、金融等需要处理大规模用户数据的业务场景。本文聚焦于MySQL分库分表这一具体实践,深入剖析了其背后的技术原理,并详细演示了如何借助ShardingSphere-JDBC这一主流中间件,从零开始实现一个完整的、可落地的分库分

congsikuai0611的博客 346

一个 Java 后端工程师的技术全景图:whatsmars 项目深度解读

whatsmars 采用两层依赖管理策略第一层:继承,获得 Spring Boot 生态的统一版本第二层:在中精确控制所有第三方依赖版本这确保了即使引入新的中间件,也不会出现版本冲突。whatsmars 这个名字来源于一句经典语录 ——,寓意着对未知技术的探索精神。系统性—— 15 大模块覆盖 Java 后端核心技术栈,不再东拼西凑对比性—— 同一领域提供多种方案,在对比中建立深度理解生产性—— 统一的依赖管理、严谨的版本控制、生产级的配置实践前瞻性。

武汉红喜 158

Sharding-JDBC分库分表实战:从原理到Spring Boot整合与避坑指南

在应对海量数据存储与高并发访问时,数据库的水平扩展是核心技术挑战之一。其核心原理是通过将数据分散到多个数据库或数据表中,以突破单机性能瓶颈。这一技术为系统带来了显著的扩展性与性能提升价值,广泛应用于电商、金融、社交等需要处理大规模用户数据的业务场景。作为该领域的轻量级Java框架,Sharding-JDBC(现为Apache ShardingSphere-JDBC)通过在应用层透明地拦截与改写JDBC操作,实现了对业务代码无侵入的分库分表能力。本文聚焦于其与Spring Boot的整合实践,深入解析了分片键

weixin_34342905的博客 347

干货:SpringCloud+Dubbo+K8S+ServiceMesh从微服务化到云原生PDF,你确定不看看?

不尽知用兵之害者,则不能尽知用兵之利。 互联网架构不断演化,经历了从集中式架构到分布式架构,再到云原生架构的过程。云原生因能解决传统应用升级缓慢、架构臃肿、无法快速迭代等问题而成了未来云端应用的目标。 随着市场需求的不断变化,信息技术也起起落落,不断更新演化。从软件到开源,再到云,每次技术演进都会满足一定的市场需求,但又会相应地带来一些新的问题,需要付出新的代价。 这份PDF首先介绍架构演化过程及云原生的概念,让读者对基础概念有一个准确的了解,接着阐述分布式、服务化、可观察性、容器调度、Service

+W❤:bjmsb2019 943

MySQL性能优化实战:从配置调优到分库分表

数据库性能优化是提升系统吞吐量和响应速度的关键技术,其核心原理在于合理分配硬件资源、优化数据访问路径。通过索引优化可以显著减少磁盘I/O操作,而配置参数调优则能有效利用内存缓冲机制。在工程实践中,MySQL性能优化涉及慢查询分析、执行计划解读、连接池配置等技术要点,特别是在高并发场景下,分库分表策略能解决单机性能瓶颈。本文基于实战经验,详细解析从基础参数调整到高级架构设计的全链路优化方法,包含索引选择性计算、死锁分析等典型问题的解决方案,帮助开发者构建高性能数据库系统。

www.itmmd.com 380

AI时代Java程序员如何抓住红利期:聚焦并发、JVM、MySQL与Spring深度技能

在软件开发领域,AI编程工具的普及正在重塑技术价值分配。从概念上讲,AI通过自动化代码生成,显著提升了基础开发效率,但其核心原理在于处理模式化任务。这带来的技术价值是,将开发者的工作重心从基础编码转向了复杂系统设计与质量保障。在应用场景上,尤其对于Java技术栈,那些涉及高并发处理、JVM深度调优、MySQL高性能架构设计以及Spring生态高级应用的场景,恰恰是AI难以替代的“深水区”。因此,Java开发者需要将核心竞争力从知识记忆转向工程化与系统化思维,例如深入理解并发编程中的线程池实战艺术与JUC工具

weixin_34216107的博客 462

Java面试实战:Spring Boot与微服务架构深度解析

Spring Boot作为Java生态中的核心框架,通过自动配置机制大幅简化了传统Spring应用的开发流程。其原理基于条件注解(如@ConditionalOnClass)和starter依赖管理,实现了开箱即用的模块化能力。在微服务架构中,Spring Cloud进一步扩展了这一优势,提供包括服务发现、API网关等分布式系统基础组件。对于日活百万级的高并发系统,合理的服务拆分(基于DDD限界上下文)和分布式事务处理(如Saga模式)成为关键设计点。本文结合电商系统改造实战,详解如何通过Redis分布式锁、

weixin_34268579的博客 361

Java面试核心讲:从基础到云原生的实战指南

Java作为企业级开发的核心语言,其技术栈的深度与广度一直是开发者面试的关键考察点。从JVM内存模型到并发编程原理,再到分布式系统设计,掌握这些核心技术不仅能提升代码质量,更是大厂面试的通行证。随着云原生技术的普及,K8s调度、Service Mesh等新兴概念也成为Java开发者必须面对的挑战。这份《Java面试突击核心讲》通过问题驱动的方式,将零散的知识点串联成体系,并结合BAT等大厂的真实工程案例,帮助开发者从原理理解到实战应用全面突破。特别适合需要快速掌握HashMap底层实现、Spring循环依赖

weixin_33816946的博客 382

AI时代Java程序员进阶指南:构建核心知识体系与实战应用

在当今技术快速发展的背景下,Java作为企业级应用开发的主流语言,其核心知识体系与工程实践能力显得尤为重要。理解Java虚拟机(JVM)的内存模型、垃圾回收机制以及并发编程原理,是构建高性能、高稳定性系统的基石。这些底层原理不仅关系到应用的性能优化,如通过JVM调优解决内存泄漏和GC停顿问题,还直接影响到系统的可扩展性和可靠性。在实际开发中,结合Spring生态和MySQL数据库,开发者能够设计出高效的数据持久层和灵活的业务架构。随着AI工具的普及,Java程序员可以将AI作为辅助工具,提升代码生成、问题排

weixin_30808693的博客 358

MySQL面试核心要点与性能优化实战指南

MySQL作为关系型数据库的核心组件,其索引结构与事务机制是数据库性能优化的基础。B+树索引通过多路平衡查找实现高效数据检索,而事务的ACID特性则依赖MVCC和锁机制实现。在工程实践中,合理的索引设计和事务隔离级别选择能显著提升系统吞吐量,特别是在高并发场景下。本文以InnoDB存储引擎为例,深入解析其MVCC实现原理和间隙锁机制,这些技术不仅解决了幻读问题,也为分库分表等分布式方案奠定了基础。通过分析执行计划和连接池配置,开发者可以快速定位性能瓶颈,而主从复制和ShardingSphere等工具则为高可

weixin_34379433的博客 375

90篇JAVA高级工程师深度进阶文章,从实践案例、项目代码出发,用事实说话

在这里,不聊虚的,不抄八股文。每一个知识点,都配上可运行的代码、压测数据或故障复盘。如果你厌倦了浮于表面的教程,渴望看到技术在高并发、复杂业务场景下的真实模样,那么,欢迎走进这个系列——我们用事实说话,用代码交锋。

雨1986的博客 1092

企业级Java面试实战:从八股文到生产决策能力

Java基础与框架原理是软件开发的底层基石,其核心在于理解字节码执行机制、JVM内存管理模型及Spring等主流框架的运行时契约。掌握这些概念,才能深入分析线程安全、事务传播、GC行为等关键问题;技术价值体现在对线上故障的快速定位与系统性调优能力,如通过Arthas诊断Full GC根因、用JMH量化锁竞争影响;典型应用场景覆盖高并发秒杀、金融级账务系统、微服务网关熔断等真实工程挑战。本文聚焦企业级Java面试中高频出现的String内存陷阱、ArrayList扩容建模、synchronized与Reent

weixin_30254435的博客 404

Cursor如何重塑Java开发:从编码工具到AI协作者

Java开发正经历从手动编码向AI协同设计的范式迁移。其核心在于理解Spring生态‘约定大于配置’的本质,以及AI对显式契约(如JSR-303注解、领域命名、依赖注入)的强依赖。Cursor并非简单代码补全器,而是通过深度解析pom.xml、application.yml、Javadoc及项目上下文,将散落的Java工程知识重构为可执行开发流。它赋能开发者聚焦事务传播、线程安全、领域建模等高阶决策,而非重复实现。典型应用场景包括Spring Boot配置迁移、MyBatis-Plus动态SQL生成、Tes

weixin_34174105的博客 505
上一篇: 如何使用 Terraform 在 AWS 上创建 ShardingSphere Proxy 高可用集群?
下一篇: ShardingSphere 5.3.1 新特性之动态数据脱敏
ShardingSphere
博客等级 码龄7年 439粉丝 137原创
评论 5
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值