- 博客(9)
- 资源 (1)
- 收藏
- 关注
原创 JSON.parseObject()不能解析转换父类属性
使用阿里巴巴的fastjson转换实体类为json,发现不能转换父类的属性需要在实体类上面加上此注解即可@ToString(callSuper=true)其他扩展注解@EqualsAndHashCode(callSuper = true)
2020-08-11 16:30:37
4273
原创 mysql字符串区分大小写的问题
当我们输入不管大小写都能查询到数据,例如:输入 aaa 或者aaA ,AAA都能查询同样的结果,说明查询条件对大小写不敏感。通过查询资料发现需要设置collate(校对) 。 collate规则:***_bin: 表示的是binary case sensitive collation,也就是说是区分大小写的_cs: case sensitive collation,区分大小写_ci: case insensitive collation,不区分大小写解决方法。1.可以将查询条件用binary()
2020-07-22 15:28:45
302
原创 No ESLint configuration found
问题原因一般有两种本机没有安装ESLintnpm init -ynpm install eslint --save-dev项目中缺少配置文件,因为使用eslint时,项目根目录下默认有一个.eslintrc.js文件如果没有,可以在项目下新建一个.eslintrc.js文件,然后进行配置就行了module.export = { rout: true, env: { browser: true, node: true },
2020-07-21 10:39:42
2645
原创 Spring Boot Maven插件打包后,包内没有BOOT-INF目录(Spring Boot Maven Plugin - No BOOT-INF directory)
使用maven插件打包后,发现包很小100来kb,显然是不对,包内缺少BOOT-INF目录,BOOT-INF是用于存放引用的外部lib的,所以缺少,打出来的包根本不能运行解决办法在自己项目的pom中,或者父pom中,在plugin中添加executions节点代码,重新打包即可解决。<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-ma
2020-07-04 15:25:36
6202
2
原创 Mysql提示Data truncation: Truncated incorrect DOUBLE value
###Mysql执行语句,抛出异常:org.springframework.dao.DataIntegrityViolationException: ### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: '10dddd'###问题原因Java对象字段类型与数据库字段类型不匹配[
2020-06-30 10:46:43
15544
原创 引用Lombok包后,注解@Slf4j,无法打印日志
如果项目中没有引用SpringBoot相关的基础包,只引用了lombok,类中注解了@Slf4j,在代码中打印日志报错,具体表现为log.没有可执行方法,则说明少包,需要引用如下包:<dependencies> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.
2020-06-22 14:08:08
7228
原创 java中数组的定义
java中数组定义有三种方式字符串数组:String[] str=new String[5];String[] str=new String[]{"a","b"};String[] str={"a","b"};整形数组:int[] i=new int[5];int[] i=new int[]{0,1};int[] i={0,1};其他类型数组定义类似
2020-05-29 09:55:22
186
原创 运行SpringBoot项目报Command line is too long. Shorten command line for异常
报错内容:Error running 'ServiceStarter': Command line is too long. Shorten command line for ServiceStarter or also for Application default configuration.解法办法:修改 .idea\workspace.xml找到标签<component name="PropertiesComponent">在标签里加一行<property...
2020-05-27 11:02:22
1820
原创 Idea中导入SpringBoot项目的Main方法右键不能run问题
关于Idea中导入SpringBoot项目的main方法右键不能run问题问题解决方法问题使用Idea打开有导入的项目 main 入口的文件,准备启动的时候发现右键并没有 Run 和 Debug。解决方法在Idea界面右侧 Maven Projects 工具栏点击上方 “+” ,选择需要启动工程的 pom 文件,点击 ok在右侧栏中就会出现该工程点击展开需要启动的工程...
2019-06-26 18:37:30
7262
2
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人