I am using JPA to generate a script for creating database tables based on my entities:
javax.persistence.schema-generation.scripts.action=create
javax.persistence.schema-generation.scripts.create-target=db_setup.sql
The file is generated with the correct tables, however the statements do not end with a semicolon, for example:
create table hibernate_sequence (next_val bigint)
insert into hibernate_sequence values ( 1 )
insert into hibernate_sequence values ( 1 )
I assume this is valid in standard SQL? However, it is not valid in MySQL. Is there a way to tell JPA to add the semicolons to the end of the line? Or what else could be the reason that it is missing?
Since Hibernate 5.1.0, the line delimiter for the generated SQL can be defined by setting the hibernate.hbm2ddl.delimiter
property, e.g.
hibernate.hbm2ddl.delimiter=";"
The default is no delimiter.
See also comments on this ticket.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With