最新亚洲精品福利在线,欧美一区二区三区大片,久久91无码一区二区三区,色哟哟免费观看视频入口,美女裸露双奶头屁股无裸体

Spring boot jpa駝峰命名會(huì)被自動(dòng)轉(zhuǎn)成數(shù)據(jù)庫下劃線命名

時(shí)間:2020-08-21 23:37:45 類型:JAVA
字號(hào):    

Spring boot jpa駝峰命名會(huì)被自動(dòng)轉(zhuǎn)成數(shù)據(jù)庫下劃線命名

例如:

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

在查詢時(shí)會(huì)變成  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


<