在Hibernate 5.0版本以上时,出现异常
org.hibernate.MappingException: entity class not found:
如果确认配置和代码都无误的情况下,可尝试增加一行代码解决:
Configuration configuration = new Configuration().configure();
//增加下行代码
configuration.addClass(News.class);
转载于:https://blog.51cto.com/rayshine/1884821