user1051218
user1051218

Reputation: 415

Hibernate hbm2ddl create-drop

I am using hibernate 3.6.x with spring and jpa persistence unit. Is there anyway to run a sql script before the schema creation ?

I need to run a some simple sql statement to create database, schema and activate postgis. Otherwise the creation of table will fail.

Upvotes: 1

Views: 180

Answers (1)

NimChimpsky
NimChimpsky

Reputation: 47290

simple sql statement to create database, schema and activate postgis

You will have to create the database and at least one user "manually". Hibernate can't do everything.

You could run some SQL using @PostConstuct annotation and a jdbc connection, but you'll still first need a DB and appropriate user to be able to connect.

(I don't know what postgis is)

Upvotes: 1

Related Questions