Neither of the scenarios works for me as it goes to loading the SQL file:
import.sql file in src/main/resources in profile DEV, TEST, PRODimport.sql file in src/test/resources in profile DEV, TEST, PRODI also tried all the properties:
%dev.quarkus.hibernate-orm.sql-load-script = db/data-test.sql%test.quarkus.hibernate-orm.sql-load-script = db/data-test.sqlWhen no file is present I get the exception that the property is not pointing to the actual file:,
Caused by: io.quarkus.deployment.configuration.ConfigurationError: Unable to find file referenced in 'quarkus.hibernate-orm.sql-load-script=db/data-test-bad.sql'. Remove property or add file to your path.
but when I fix the path the file is not loaded anyways. I even added some no-SQL statement hoping to see errors, but nothing happens.
Environment (please complete the following information):
java -version: JDK 11Additional context
Related to:
Could you provide a reproducer? Thanks!
@gsmet: I prepared the sample so you can test every scenario I described. The only thing: run the postgres server (docker command in project's README) before starting the application.
Thanks @kolorobot
I'll take a look tonight
Looking at this real quick, it seems like ParsedPersistenceXmlDescriptor get's populated with the proper file.
Also the runtime logs for Hibernate do show that hibernate.hbm2ddl.import_files uses the proper value. I could dig more but it probably makes more sense for someone with Hibernate internals knowledge to check, they will definitely be able to make faster progress than me :)
I did find the same issue, until I've realized that Hibernate only runs the import file if the database.generation is set to create. Not sure if this is the issue of the @kolorobot, but maybe it is.
Most helpful comment
I did find the same issue, until I've realized that Hibernate only runs the import file if the
database.generationis set tocreate. Not sure if this is the issue of the @kolorobot, but maybe it is.