I'm doing a batch based on Quarkus.
This is my application.properties:
# datasource configuration
quarkus.datasource.db-kind = oracle
quarkus.datasource.username = XXX
quarkus.datasource.password = XXX
quarkus.datasource.jdbc.url = jdbc:oracle:thin:...
quarkus.hibernate-orm.database.generation=none
quarkus.hibernate-orm.database.default-schema=MYSCHEMA
quarkus.hibernate-orm.dialect=org.hibernate.dialect.Oracle10gDialect
This is MyApp class method, just a trial to check if everything works properly:
public class MyApp implements QuarkusApplication {
@Inject
Logger logger;
@Inject
MyDAO myDAO;
@Override
public int run(String... args) {
logger.info("Do startup logic here");
logger.info("Printing args...");
Arrays.stream(args).forEach(logger::info);
fetch();
Quarkus.waitForExit();
return 0;
}
@Transactional
protected void fetch() {
logger.info("fetching riga ordine...");
final MyEntity output = myDAO.findById("id");
logger.info("output: {}", output);
}
}
When I run my application, fetch() method works and I can retrieve MyEntity successfully, however I also get this annoying error:
2022-01-28 11:24:57,450 ERROR [io.qua.hib.orm.run.sch.SchemaManagementIntegrator] (Hibernate post-boot validation thread for <default>) Failed to validate Schema: Schema-validation: missing table [MY_TABLE]
2022-01-28 11:24:57,782 ERROR [io.qua.hib.orm.run.sch.SchemaManagementIntegrator] (Hibernate post-boot validation thread for <default>) The following SQL may resolve the database issues, as generated by the Hibernate schema migration tool. WARNING: You must manually verify this SQL is correct, this is a best effort guess, do not copy/paste it without verifying that it does what you expect.
create table MY_TABLE...
Basically, I can't understand two things:
<property name="hibernate.hbm2ddl.auto" value="none" />
but I can't see how to replicate it with quarkus.
Despite I correctly set schema on application.properties with
quarkus.hibernate-orm.database.default-schema=MYSCHEMA
I receive the schema validation error.
The proof is that using @Table annotation with schema="MYSCHEMA" I don't receive this error (however I don't want to stub schema on entity).
To disable the schema validation, set quarkus.hibernate-orm.validate-in-dev-mode
to false
in your application.properties
.