JAVA 第9页
全面解析Spring中@ModelAttribute注解的用法-Ddmit

全面解析Spring中@ModelAttribute注解的用法

@ModelAttribute注解用于将方法的参数或方法的返回值绑定到指定的模型属性上,并返回给Web视图。具体用法整理如下: 1.@ModelAttribute注释方法 下面的1),2),3)这三个例子类似,被@ModelAt...
ddmit的头像-DdmitDdmit6年前
062299
Mybatis如何将Oracle数据库返回结果转换为驼峰格式-Ddmit

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

有如下几种方式实现: 配置mybatis的mapUnderscoreToCamelCase选项; 定义一个resultMap来实现表字段和结果属性的映射; 使用'AS'关键字指定别名; 前两种方式都需要定义一个实体类,第三种方式...
ddmit的头像-DdmitDdmit6年前
019280
Mybatis中if判断的正确使用方式(mybatis的if判断真是坑)-Ddmit

Mybatis中if判断的正确使用方式(mybatis的if判断真是坑)

Mybatis中if判断的正确使用方式整理如下: 1.Mybatis使用if判断单个字符相等 示例: 比如要判断类型等于'1' 正确方式: <if test='type == '1''> 或者 <if test='type == '1'.toString...
ddmit的头像-DdmitDdmit6年前
033580
如何将Map键值的下划线转为驼峰-Ddmit

如何将Map键值的下划线转为驼峰

例,将HashMap实例extMap键值下划线转为驼峰: 代码: HashMap<String,Object> extMap = new HashMap<>(); extMap.put('ORGAN_NAME','四个空格'); extMap.put('WEB_SITE','https://...
ddmit的头像-DdmitDdmit6年前
016561
Spring Data Neo4j禁用健康检查-Ddmit

Spring Data Neo4j禁用健康检查

在使用Neo4j图谱的过程中,当Neo4j数据库没有启动的使用,默认应用程序就不断的进行健康检查,检测数据库是否能够正常连接,当没有启动Neo4j数据库的使用,应用程序就会报错,提示无法进行连接...
ddmit的头像-DdmitDdmit6年前
020380
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年前
041240
SpringMVC框架整合Mybatis配置多个数据库-Ddmit

SpringMVC框架整合Mybatis配置多个数据库

环境 Spring:3.1; Mybatis:3.1; 数据库:我这里是不存在主从关系的、相互独立的两个oracle数据库; 需求 系统本身是Oracle数据库,但是系统中的个别功能是查询另外的数据库(我这里是echarts...
ddmit的头像-DdmitDdmit6年前
01.2W+1
mybatis generator自动生成代码插件example类设置order by排序字段-Ddmit

mybatis generator自动生成代码插件example类设置order by排序字段

使用Mybatis generator代码自动生成插件生成的example类如何设置排序字段呢? 设置排序字段的代码如下: Example example = new Example(MessageSend.class); example.setOrderByClause('SEND_T...
ddmit的头像-DdmitDdmit6年前
029920
jackson使用Map转Java Bean报错:UnrecognizedPropertyException-Ddmit

jackson使用Map转Java Bean报错:UnrecognizedPropertyException

在使用jackson将Map类属性转换为Java实体类的过程中出现以下错误: 错误信息 com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field 'receiverIds' (class co...
ddmit的头像-DdmitDdmit6年前
021040
Java中随机获取List的集合的元素-Ddmit

Java中随机获取List的集合的元素

实现代码如下: List<VCard> vcards = new ArrayList<>(); // add some elements to vcards ... // 随机 100 Random r = new Random(); List<VCard> randomList = new ArrayL...
ddmit的头像-DdmitDdmit6年前
017550