Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make hibernate hbm2ddl generate SQL with semicolon?

I use hibernate hbm2ddl to generate db schema script from entity classes. It works well but each line ends without a semicolon, which makes me have to manually add them. Is there any way to save me from this stupid job?

like image 350
nixil Avatar asked Apr 18 '12 02:04

nixil


2 Answers

using SchemaExport directly it is simple:

new SchemaExport(config).setDelimiter(";").Execute(...);
like image 109
Firo Avatar answered Nov 07 '22 19:11

Firo


You can set hibernate.hbm2ddl.delimiter to ; in your Hibernate properties, or set AvailableSettings.HBM2DDL_DELIMITER to ; if you're configuring Hibernate programmatically.

like image 31
jstricker Avatar answered Nov 07 '22 17:11

jstricker