这是我的mysql专栏
staffGroup varchar(255) utf8_general_ci
这是我的实体映射
@Column(name = "staffGroup")
private String staffGroup;
这是我的标准
public List<Staff> getStaff() {
Session session = sessionFactory.getCurrentSession();
return (List<Staff>) session.createCriteria(Staff.class).list();
}
hibernate 显示此错误消息
o.h.engine.jdbc.spi.SqlExceptionHelper : Unknown column 'this_.staff_group' in 'field list'
最佳答案
应用程序属性
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
关于mysql - 如何在 spring 上映射大写列名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48118650/