学无先后,达者为师

网站首页 编程语言 正文

mybatis-plus插入数据库值无效(插入不对,没有插入数据库默认值,int的类型的null会变成0)

作者:小徐敲java 更新时间: 2024-04-07 编程语言

1:实体类对应的数据库表的字段,实体类必须使用对象类,类似用Integer,不可以用int,不然插入不正确

@Data
@TableName("sys_study_test_file")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="练习试卷对象", description="练习试卷对象")
public class SysStudyTestFile {
	/**练习文件id*/
	@TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "练习文件id")
	private Integer testFileId;

	/**学习类型*/
    @ApiModelProperty(value = "学习类型")
	private String studyType;

	/**学习类型id*/
	@ApiModelProperty(value = "学习类型id")
	private Integer studyTypeId;
}

原文链接:https://blog.csdn.net/qq_19891197/article/details/128553690

  • 上一篇:没有了
  • 下一篇:没有了
栏目分类
最近更新