ITeye博客

2019 年文章归档

共 7 篇文章

gitlab readme 测试覆盖率添加

第一步:添加一个子模块:contract-coverage,然后在这个空的模块里只要发一个pom.xml即可,内容如下: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.…

2019-04-15 14:39 · git · springboot · coverage

mysql idea 连接被否决[28000][1045] Access denied for user 'root'@'172.17.0.1' (using

idea连接docker里的mysql镜像时报错: [28000][1045] Access denied for user 'root'@'172.17.0.1' (using password: YES) 解决: 命令:docker exec -it mysql /bin/bash 进入mysql:mysql -uroot -proot 开启远程访问: ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';

2019-04-01 20:10

重写rest delete

第一种: @Transactional @Modifying @Query(value = "UPDATE UserPO SET voided = 1 where id = ?1") @Override void deleteById(@NotNull Long userId); 第二种:(更底层) @Entity @Table(name="TABLE") @ActionOverride(action="delete", with="activeFlag = false") public class Table { @Column(name="ACTIVE_FLAG") boolean ac…

2019-03-04 11:32 · mysql,jpa,hibernate

word 宏 更新域 VBA语法

打开一个word文档 第一步:定义宏 视图 中找到宏 输入宏名称setValue ,回车后编辑宏的内容如下 Sub setValue() ' ' setValue 宏 ' Dim doc_var As Variable For Each doc_var In ActiveDocument.Variables doc_var.Delete Next ActiveDocument.Variables("name").value = "zhangyan" ActiveDocument.Variables("address").value = "shanghai" ActiveDocument.Va…

2019-02-01 17:50 · office

CommandLineRunner 的使用

@SpringBootApplication @EnableJpaAuditing public class ContractElementApplication extends MyApplication implements CommandLineRunner { public static void main(String[] args) { run(ContractElementApplication.class, args); } @Autowired private ElementDatasourceConfig elementDatasourceConfig; @Overrid…

2019-01-28 10:19 · springboot

springboot map<String,MyObject> config application.yml

参考官网:https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html 章节: 24.8.3 Merging Complex Types application.yml element-datasource: config: service1: url: method: content-type: service2: url: method: content-type: @Component @Configuration @ConfigurationPrope…

2019-01-25 23:34 · springboot

JPA操作多对多中间表CRUD

authority 角色 permission 权限 authority_permission 中间表 现在要对中间表进行操作,但是中间表的两个字段分别是两个主表的外键,而不是主键,所以要给这张中间表创建一个联合主键,然后就可以对中间表进行操作了, 详见 AuthorityPermission.java AuthorityPermissionId.java @Entity @Table(name = "authority", schema = "msa") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @Data …

2019-01-14 15:41 · mysql,jpa,hibernate