mysql int类型字段插入空字符串时自动转为0 如果不想转的话可以修改配置文件 修改 my.ini 文件. # Set the SQL mode to strictsql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION” 改为: # Set the SQL mode to strictsql-mode=”NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”
引言:最近在工作中遇到与某些API对接的post的数据需要将对象的字段首字母小写.解决办法有两种:第一种:使用对象的字段属性设置JsonProperty来实现(不推荐,因为需要手动的修改每个字段的属性) public class UserInfo { [JsonProperty("id")] public int Id{ set; get; } [JsonProperty("userName")] public string UserName{ set; get;
引言:最近在工作中遇到与某些API对接的post的数据需要将对象的字段首字母小写.解决办法有两种:第一种:使用对象的字段属性设置JsonProperty来实现(不推荐,因为需要手动的修改每个字段的属性) public class UserInfo { [JsonProperty("id")] public int Id{ set; get; } [JsonProperty("userName")] public string UserName{ set; get;
今天工作使用fastjson要求传过去的参数全为大写,在使用的过程中发现它自动将我的字段首字母转为小写了,在网上查了一些资料,发现下面的这个挺好,比其他的要方便. package com.alibaba.fastjson.serializer; public class PascalNameFilter implements NameFilter { public String process(Object source, String name, Object value) { if (nam
实体类:private Date cDateTime;private String cNickname; public Date getcDateTime() { return cDateTime;} public void setcDateTime(Date cDateTime) { this.cDateTime = cDateTime;} public String getcNickname() { return cNickname;} public void setcNickname(St