I have configured two persistence units in my JPA/Hibernate configuration. Now i need to execute different import.sql for each persistence unit. How can I specify which import.sql should be executed for each persistence unit? According Hibernate to documentation, I should place import.sql in classpath. If I do that, import.sql is executed on each persistence unit. I need somehow to specify different import.sql for each persistence unit.
FWIW, this is possible with Hibernate 3.6.0.Beta1 (see HHH-5337), you can now declare what file(s) to import using the hibernate.hbm2ddl.import_files property:
hibernate.hbm2ddl.import_files /mydbload.sql,/mydbload2.sql
So you could use different values for each persistence unit.
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