JAVA 第3页
Java实现neo4j图谱数据保存出错解决办法-Ddmit

Java实现neo4j图谱数据保存出错解决办法

背景 Java实现neo4j图谱保存数据出错: org.neo4j.driver.v1.exceptions.ClientException: Property values can only be of primitive types or arrays thereof at org.neo4j.driver.internal.u...
ddmit的头像-DdmitDdmit6年前
028440
Java字符串格式化错误:IllegalFormatConversionException原因-Ddmit

Java字符串格式化错误:IllegalFormatConversionException原因

背景:想对字符串进行格式化,前面补零操作,代码如下: if (!StringUtils.equals('0', areaCode.getCity()) && StringUtils.equals('0', areaCode.getArea()) && StringUtils....
ddmit的头像-DdmitDdmit5年前
026370
Java有效编程:使用构建器来处理构造函数有多个参数的情形-Ddmit

Java有效编程:使用构建器来处理构造函数有多个参数的情形

1. 问题引入 在Java中,会碰到这种情形:以一个类为例,它表示包装食品上的营养标签。这个标签包含必需字段,如:净含量、毛重和每单位份量的卡路里,可选的字段,如:总脂肪、饱和脂肪、反式脂...
ddmit的头像-DdmitDdmit3年前
09540
Java中保留小数(精确到小数点几位)-Ddmit

Java中保留小数(精确到小数点几位)

这里提供三种实现方式: 实现代码 import java.math.BigDecimal; import java.text.DecimalFormat; /** * @author 四个空格-https://www.4spaces.org/ */ public class JavaSetScale { public s...
ddmit的头像-DdmitDdmit6年前
022790
Content type ‘application/x-www-form-urlencoded;charset=UTF-8’ not supported解决-Ddmit

Content type ‘application/x-www-form-urlencoded;charset=UTF-8’ not supported解决

Spring报错:org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported,具体解决办法如下: @PostMappin...
ddmit的头像-DdmitDdmit6年前
032220
解决Idea创建Maven项目时一直显示Loading archetype list…-Ddmit

解决Idea创建Maven项目时一直显示Loading archetype list…

方法1:更改maven设置 方法2:删除文件,重新生成 删除文件{User_Home}/.IntelliJIdea{Version}/system/Maven/Indices ,重启Idea!
ddmit的头像-DdmitDdmit6年前
021480
普通Java类获取Spring Bean的实现方式-Ddmit

普通Java类获取Spring Bean的实现方式

方式1:实现ApplicationContextAware接口 步骤: 1.写一个工具类,实现ApplicationContextAware接口; 2.将此工具类在spring配置文件中配置; 3.在类中调用; 工具类代码: public class Spring...
ddmit的头像-DdmitDdmit6年前
018800
阿里巴巴fastjson使用示例-Ddmit

阿里巴巴fastjson使用示例

官方维基:新手指南; 示例数据1: String jsonString = { 'edges': { 'oim-6i8-1lp1-6h4': { 'id': 'oim-6i8-1lp1-6h4', 'label': 'link.legalperson', 'linkName': '法人关系', 'source': '84...
ddmit的头像-DdmitDdmit5年前
019061
Mybatis如何将Oracle数据库返回结果转换为驼峰格式-Ddmit

Mybatis如何将Oracle数据库返回结果转换为驼峰格式

有如下几种方式实现: 配置mybatis的mapUnderscoreToCamelCase选项; 定义一个resultMap来实现表字段和结果属性的映射; 使用'AS'关键字指定别名; 前两种方式都需要定义一个实体类,第三种方式...
ddmit的头像-DdmitDdmit6年前
019270
在Java中如何对中文按照拼音/数字进行排序-Ddmit

在Java中如何对中文按照拼音/数字进行排序

在Java中对中文的排序比较复杂,涵盖了纯中文、中文中包含大写数字、中文包含阿拉伯数字等情形。 1.按照字母(拼音)进行排序 借助java.text.Collator: // 按姓名首字母排序 Collections.sort(st...
ddmit的头像-DdmitDdmit5年前
020292