1

I have an entity class as follows:

@Entity(name = "companyCode")
@Table(name = "companyCode")
public class CompanyCode {

    @Id
    @Column(name = "companyCode")
    String cCode;
}

Instead of creating the table name as companyCode in sql it creates the table as "company_code". The column name is also created as "company_code".

Table in mysql: enter image description here

Is there any way to create the table and column using camelCase instead of snake case?

Java Version: 11

Spring Boot version: 2.7.0

Spring Data JPA Version: Latest

1 Answers1

2

FOUND THE ANSWER. Set naming strategy in hibernate in application property as

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

link for reference: Unable to set NamingStrategy using Spring Boot + GORM + Gradle