jpa - Entity Class name is transformed into SQL table name with underscores -
i have following entity defined:
@entity @table(name = "emailtemplate") public class emailtemplate {
despite table annotation, receive java.sql.sqlexception: invalid object name 'email_template'. how can prevent entity class such emailtemplate being transformed email_template table name?
edit:
i'm using spring boot: start jpa. build.gradle file,
compile("org.springframework.boot:spring-boot-starter-data-jpa")
spring default uses org.springframework.boot.orm.jpa.springnamingstrategy
splits camel case names underscore. try setting spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ejb3namingstrategy
in application.properties
. check out this , this more info.
Comments
Post a Comment