Re-create H2 schema in Hibernate programatically

Refresh

November 2018

Views

330 time

0

I'd like to use an in-memory db (H2) to preprocess, validate, etc some import-data before persisting it to the "real" production database. Prior to each import I'd like to recreate the H2 schema to have a clean database, as with hibernate.hbm2ddl.auto:"create". Is there any way to call hbm2ddl programatically or how else can I trigger the schema creation?

I'm using Spring Boot 1.3.3 with Hibernate 5.0.5.

Thank you for your help!

Cheers, Maria

1 answers

0

в то же время я нашел следующее решение , и она работала для меня: https://github.com/valery-barysok/spring4-hibernate5-stackoverflow-34612019

Решение объясняется в программной SchemaExport / SchemaUpdate с Hibernate 5 и пружиной 4

Спасибо, Мария