Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

mysql - Hibernate scheme naming differs between OS

I am facing the problem that the hibernate generated schema names (table names for example) differ between Windows and Linux. On Windows all table names are small case, e.g. account, whereas under Linux created table names are camel cases, e.g. Account.

On both systems I use MySQL 5 in the same version and the following hibernate config:

<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
<prop key="hibernate.jdbc.batch_size">0</prop>
<prop key="hibernate.bytecode.provider">cglib</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop> 

What happens here? Basically I can live with that weird issue, but sometimes its annoying I cannot just export my tables from my windows IDE to my linux environment.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You might want to set the property hibernate.ejb.naming_strategy to org.hibernate.cfg.ImprovedNamingStrategy or implement your own naming strategy class.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...