240 发简信
IP属地:四川
  • 找了那么久,这是唯一能用的。

    element-ui 树(tree)组件只能单选实现

    原生组件中element-ui的tree组件是没有单选这个api的,只有多选。可是很多实际项目中其实是有这样需求的,比如我就遇到了。然后想办法实现了,如果你也刚好需要,拿走不...

  • 120
    element-ui 树(tree)组件只能单选实现

    原生组件中element-ui的tree组件是没有单选这个api的,只有多选。可是很多实际项目中其实是有这样需求的,比如我就遇到了。然后想办法实现了,如果你也刚好需要,拿走不...

  • 你就不能从添加依赖开始吗?

    Netty入门教程2——动手搭建HttpServer

    上一篇:Netty学习笔记1——认识Netty 在上一章中我们认识了netty,他有三大优点:并发高,传输快,封装好。在这一章我们来用Netty搭建一个HttpServer,...

  • is not null是不走索引。
    是错误的。
    经过我自己的测试,不管是is null还是is not null,走不走索引是看命中数据量占总量的一个比例来看的。走索引,不走索引的情况都会出现。

    MySQL中NULL对索引的影响

    看了很多博客,也听过很多人说,包括我们公司的DBA,说MySql中如果某一列中含有null,那么包含该列的索引就无效了。 翻了下《高性能MySQL第二版》和《MySQL技术内...

  • 找到原因了,mapper.xml中的表名order需要`order`

    Springboot整合 ShardingSphere 实现分库分表

    概述 之前介绍过分布式系统中,分库分表分区的概念,可参考 《分布式系统中,数据库的分表、分库和分区基本概念梳理[https://www.jianshu.com/p/432b6...

  • 附表结构:
    CREATE TABLE `order_1` (
    `order_id` bigint(10) unsigned NOT NULL,
    `user_id` bigint(10) unsigned NOT NULL,
    `company_id` tinyint(3) unsigned NOT NULL,
    `created_at` timestamp NOT NULL,
    PRIMARY KEY (`order_id`),
    KEY `user_company` (`user_id`,`company_id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

    Springboot整合 ShardingSphere 实现分库分表

    概述 之前介绍过分布式系统中,分库分表分区的概念,可参考 《分布式系统中,数据库的分表、分库和分区基本概念梳理[https://www.jianshu.com/p/432b6...

  • 兄弟,我按照你的操作设置,插入数据报错。
    spring:
    shardingsphere:
    datasource:
    names: springbootdb0, springbootdb1 #数据源
    #第一个数据源
    springbootdb0:
    type: com.zaxxer.hikari.HikariDataSource
    driver-class-name: com.mysql.cj.jdbc.Driver
    jdbc-url: jdbc:mysql://x.x.x.x:3306/springbootdb0
    username: root
    password: "123456"
    #配置第二个数据源
    springbootdb1:
    type: com.zaxxer.hikari.HikariDataSource
    driver-class-name: com.mysql.cj.jdbc.Driver
    jdbc-url: jdbc:mysql://x.x.x.x:3306/springbootdb1
    username: root
    password: "123456"
    #分库策略
    sharding:
    default-database-strategy:
    inline:
    sharding-column: company_id
    algorithm-expression: springbootdb$->{company_id % 2}
    tables:
    order:
    actual-data-nodes: springbootdb$->{0..1}.order_$->{0..2}
    table-strategy:
    inline:
    sharding-column: user_id
    algorithm-expression: order_$->{user_id % 3}
    key-generator:
    column: order_id
    type: SNOWFLAKE
    props:
    sql:
    show: true

    mybatis:
    mapper-locations: classpath:mapper/*.xml
    logging:
    level:
    com:
    example: debug

    报错:
    2021-11-08 22:50:54.108 ERROR 11232 --- [nio-8080-exec-1] c.e.demo.controller.OrderController : 插入订单失败:nested exception is org.apache.ibatis.exceptions.PersistenceException:
    ### Error updating database. Cause: java.lang.IllegalStateException
    ### The error may exist in file [C:\code\java\spring-boot-demo\target\classes\mapper\OrderMapper.xml]
    ### The error may involve com.example.demo.dao.OrderDao.insert-Inline
    ### The error occurred while setting parameters
    ### SQL: insert into order (user_id, company_id, created_at ) values (?, ?, ? )
    ### Cause: java.lang.IllegalStateException
    求指导。

    Springboot整合 ShardingSphere 实现分库分表

    概述 之前介绍过分布式系统中,分库分表分区的概念,可参考 《分布式系统中,数据库的分表、分库和分区基本概念梳理[https://www.jianshu.com/p/432b6...

  • 关于对docker run --link的理解

    前言 在实践中,自己会遇到2个容器之间互相访问通信的问题,这个时候就用到了docker run --link选项。自己也花了一段时间泡官网研究了--link的用法,把自己对-...

  • REQUIRED_NEW的情况下,按我的理解应该是内层事务回滚,外层事务提交。我实际测试结果表中并没有user数据,请问是怎么回事?是我理解的有问题吗

    SpringBoot 数据库事务7种传播行为

    1. REQUIRED 如果当前方法的执行上下文中已经打开了事务,那么就使用当前这个事务。 如果当前没有事务,就创建一个新的。 如果多个方法都声明了 REQUIRED,并且他...

  • 从中我们可以知道小程序的生命周期函数的调用顺序为:onLoad>onReady>onShow;
    写错了

    小程序 — 小程序生命周期及页面生命周期

    前言:很多同学容易将小程序生命周期和页面的生命周期混淆为一起,这两个其实应该是不同却又相互关联的生命周期,所以,用实际代码操作并结合官方理论讲讲这个,好好捋捋。 小程序生命周...