JAVA 第2页
IntelliJ Idea提示:Field injection is not recommended解决办法-Ddmit

IntelliJ Idea提示:Field injection is not recommended解决办法

Idea开发过程中,注入服务时,提示:Field injection is not recommended,错误如下图: 解决办法 原代码: @Service public class DmDataTableService extends AbstractService<DmDataTable...
ddmit的头像-DdmitDdmit5年前
050070
Java 8中如何获取Map对象的第一个元素-Ddmit

Java 8中如何获取Map对象的第一个元素

在Java 8中可以通过下面的方式获取Map对象的第一个元素: 1.获取元素键 //if order is important, e.g. with a TreeMap/LinkedHashMap map.keySet().stream().findFirst(); //if order is not i...
ddmit的头像-DdmitDdmit6年前
047972
Java获取路径时Class.getResource()和ClassLoader.getResource()区别-Ddmit

Java获取路径时Class.getResource()和ClassLoader.getResource()区别

Java中取资源时,经常用到Class.getResource()和ClassLoader.getResource(),Class.getResourceAsStream()和ClassLoader().getResourceAsStream(),这里来看看他们在取资源文件时候的路径有什么...
ddmit的头像-DdmitDdmit6年前
045421
Maven配置之MyBatis Generator Maven Plugin(三步学会使用MyBatis Generator生成代码)-Ddmit

Maven配置之MyBatis Generator Maven Plugin(三步学会使用MyBatis Generator生成代码)

学习使用Maven Mybatis插件MyBatis Generator Maven Plugin自动生成实体类、Example类等详细配置。 开发环境:IntelliJ IDEA 2018.3 1.添加插件依赖 插件依赖如下: <plugin> <groupId...
ddmit的头像-DdmitDdmit6年前
042000
MyBatis Generator生成代码报错:Table configuration with catalog null-Ddmit

MyBatis Generator生成代码报错:Table configuration with catalog null

使用MyBatis Generator生成代码报错信息如下: [WARNING] Table configuration with catalog null, schema xe, and table SR_CLASS did not resolve to any tables 数据库是oracle,错误原因是...
ddmit的头像-DdmitDdmit6年前
041230
Google Gson报错:java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast to解决办法-Ddmit

Google Gson报错:java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast to解决办法

Google Gson报错:java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast to解决办法 错误信息: java.lang.ClassCastException: com.google.gson.internal.Li...
ddmit的头像-DdmitDdmit6年前
041121
ffmpeg视频合并Unsafe file name问题解决-Ddmit

ffmpeg视频合并Unsafe file name问题解决

使用ffmpeg进行多个视频合并过程中出现了“unsafe file name”错误,解决的办法是加个-safe 0 参数: ./ffmpeg.exe -f concat -safe 0 -i ./fileToMerge.txt -c copy -y ./out.mp4 上面的命令是...
ddmit的头像-DdmitDdmit6年前
041040
将Java对象转换为Map对象-Ddmit

将Java对象转换为Map对象

在Java中,你可以使用Jackson库实现Java对象和Map类的转换。 1.获取Jackson <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databi...
ddmit的头像-DdmitDdmit6年前
037720
使用fastjson实现Map和Java Bean互转-Ddmit

使用fastjson实现Map和Java Bean互转

Map转Java Bean: public ResponseResult addDataTable(Map<String, Object> params) { String jsonString = JSON.toJSONString(params); DmDataTable dataTable = JSON.parseObject(json...
ddmit的头像-DdmitDdmit5年前
036730
ureport2报表工具汇总sum表达式使用-Ddmit

ureport2报表工具汇总sum表达式使用

ureport2报表工具设置汇总的重点在于找好父格,比如我需要对一列进行汇总,就需要设置好当前单元格的上父格,如下:
ddmit的头像-DdmitDdmit6年前
136481