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

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -