【转】Spring Boot 2.0.2 使用 hibernat

2019-03-29  本文已影响0人  IT晴天

把一个旧项目的mybatis-plus从2.x升级到3.x,发现hibernate validator提示【已过时】了,平时还没注意这个,强迫症还是把它处理了,小记一下:
把下面的

import org.hibernate.validator.constraints.NotBlank;   // 已经过时了

替换为

import javax.validation.constraints.NotBlank;

说明:spring-boot 2.x中,spring-boot-starter-web jar 集成了hibernate-validator,故改为使用这个包名;

资料来源于:https://blog.csdn.net/u013107634/article/details/80639412

至于hibernate validator的使用说明,可以看看此文,其中使用注意:
http://www.leftso.com/blog/328.html

上一篇 下一篇

猜你喜欢

热点阅读