在线一区二区三区高清视频,国产精品妇女一二三区,美女被遭强高潮网站在线播放,实拍各种胸走光见奶头

Spring boot jpa駝峰命名會被自動轉成數(shù)據(jù)庫下劃線命名

時間:2020-08-21 23:37:45 類型:JAVA
字號:    

Spring boot jpa駝峰命名會被自動轉成數(shù)據(jù)庫下劃線命名

例如:

@Query(value=" select * from sorts where parentId = ?1 order by orders asc ",nativeQuery=true )
public ArrayList<Sorts> selectByParentId(Integer id) ;

在查詢時會變成  where parent_id

從而造成 column parent_id不存在


解決方案:

在application.properties中添加

spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl

spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl


<