解决jpa中Entity类中column注解name属性失效问题
2017-03-24 18:05
615 查看
项目使用spring boot构建。开发的过程中遇到Spring Data JPA @Column 注解无效。
出现could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
的错误,这是由于jpa默认才用的命名策略的问题。
直接上解决方案
在application.properties用spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
替换
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
参考http://stackoverflow.com/questions/25283198/spring-boot-jpa-column-name-annotation-ignored
出现could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
的错误,这是由于jpa默认才用的命名策略的问题。
直接上解决方案
在application.properties用spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
替换
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
参考http://stackoverflow.com/questions/25283198/spring-boot-jpa-column-name-annotation-ignored
相关文章推荐
- 解决jpa中Entity类中column注解name属性失效问题
- 在参数上使用@Param(“paramName”)注解”解决了传多个参数的问题
- CSS中margin-top属性失效问题解决
- [o] duplicate column name: _id 问题解决
- 解决自定义AuthorizeAttribute实现授权管理,AllowAnonymous属性失效导致无法匿名访问控制器的问题
- 在Android的TableLayout布局中,column和span属性“失效”原因分析与解决
- 基于注解的Spring MVC与JPA如何解决实体的延时加载问题
- ORA-12899: 列”UserName”.”TableName”.”Column”的值太大(实际值: m ,最大值:n ) 问题解决
- SpringDateJpa 注解 Column属性 详解
- Spring Data JPA配置事务失效问题解决
- struts1.x tag 引起的 form 只生成id属性, 不生成name属性的问题及解决方法
- 解决数据库 data too long for column 'name' at row 1的问题
- sql server存储过程:错误21037: [SQL-DMO]在Text 属性的“CREATE...”语句中指定的名称必须与Name....问题解决
- 解决 android 下sqlite3_column_table_name 编译不过的问题
- jquery动态改变onclick属性导致失效的问题解决方法
- CSS中margin-top属性失效问题解决
- jquery动态改变onclick属性导致失效的问题解决方法
- 非J2EE 容器环境下Spring +JPA 多持久化单元/多个JAR归档注解实体 的实体扫描问题及解决办法
- 解决Ext.form.TextField的 maxLength 属性失效问题
- spring注解实现业务层事务管理,当业务层自调用时,事务失效问题解决